lix/src/nix/profile-upgrade.md
Qyriad 19645a4a64 Merge changes Id1a67156,I03f4c7c1,I146736bb,I3b1453cb into main
* changes:
  docs: clarify how ^ works for -E/-f installables
  docs: give translation examples from nix-build -E/-A to installables
  docs: clarify how the different kinds of installables are selected
  docs: guide to installables docs in installable commands' docs
2024-05-03 13:39:49 +00:00

933 B

R""(

Note: unlike nix profile install, this command does not take installables.

Examples

  • Upgrade all packages that were installed using an unlocked flake reference:

    # nix profile upgrade '.*'
    
  • Upgrade a specific package by name:

    # nix profile upgrade hello
    
    # nix profile upgrade packages.x86_64-linux.hello
    

Description

This command upgrades a previously installed package in a Nix profile, by fetching and evaluating the latest version of the flake from which the package was installed.

Warning

This only works if you used an unlocked flake reference at installation time, e.g. nixpkgs#hello. It does not work if you used a locked flake reference (e.g. github:NixOS/nixpkgs/13d0c311e3ae923a00f734b43fd1d35b47d8943a#hello), since in that case the "latest version" is always the same.

)""