-
Notifications
You must be signed in to change notification settings - Fork 0
Maintenance
Marcus Whybrow edited this page Nov 21, 2024
·
3 revisions
sudo nix store gc --verbose
Will remove (garbage collect) all unused Nix packages in /nix/store
.
Packages are considered active if they are part of a package linked in /var/nix/profiles
. Each link constitutes a "generation" of the system which may be ran, and all packages required by a generation are considered active, and not deleted by Nix Store garbage collection.
List extant generations using ls -tl /var/nix/profiles
.
Unlink any superfluous generation using, say, unlink /var/nix/profiles/system-3-link
.
Run sudo nix store gc --verbose
again to remove any newly inactive packages from /nix/store
.