Nix commands error

Nearly all nix commands error for me:

sudo nixos-rebuild switch --upgrade
...
error: getting attributes of path '/nix/store/2xwxj5qrrc71asdk1wyq19nz9k845pzs-patchelf-0.9': No such file or directory

or

nix-shell -p emacs
...
error: getting attributes of path '/nix/store/1mwl1ycqdxqs9g1g916q3pp65vp01kdl-texinfo-6.5': No such file or directory

Any idea what’s going on?

may want to do:

nix-channel --update
sudo nix-channel --update

Then try again

Thanks for the quick reply. Unfortunately, that didn’t help. Same output & error.

May I suggest to run nix-store --verify --check-content an
paste any weird output here ?

You may get a bit more context from the nix manual, or at

2 Likes

Thanks. Running that resulted in a ton of output like /nix/store/foo not found. Removing from database and things seem to be working now.