No free disk space and a lot of duplicates in /nix/store

I tried to use the following commands to remove unused packages and remove duplicates:

  • nix-collect-garbage --delete-old
  • nix-store --gc

But still there are a lot of duplicates:

What can I do?

Did you do this as root with sudo?

Yes. But you gave me an idea. I did it without sudo and duplicates has been removed.

nix-collect-garbage is per user, so you need to execute it per each user that might have store paths that need cleaning up

2 Likes