Skip to content

Instantly share code, notes, and snippets.

@markgreene74
Last active October 21, 2025 16:48
Show Gist options
  • Select an option

  • Save markgreene74/e732db84037007e12c510b1be71a3029 to your computer and use it in GitHub Desktop.

Select an option

Save markgreene74/e732db84037007e12c510b1be71a3029 to your computer and use it in GitHub Desktop.
NixOS - update all the packages

steps

  • check the current channel
    sudo nix-channel --list
    
  • (optional) set a new channel
    sudo nix-channel --remove nixos
    sudo nix-channel --add https://nixos.org/channels/nixos-XX.YY nixos
    
  • update the current channel
    sudo nix-channel --update
    
  • update the packages
    sudo nixos-rebuild switch
    
  • free up disk space
    sudo nix-collect-garbage && sudo nix-collect-garbage -d
    

reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment