nix-collect-garbage
Delete unused and unreachable nix store paths.
Generations can be listed using nix-env --list-generations
.
More information: https://nixos.org/releases/nix/latest/manual/#sec-nix-collect-garbage.
-
Delete all store paths unused by current generations of each profile:
sudo nix-collect-garbage --delete-old
-
Simulate the deletion of old store paths:
sudo nix-collect-garbage --delete-old --dry-run
-
Delete all store paths older than 30 days:
sudo nix-collect-garbage --delete-older-than 30d
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.