Nix upgrade installs old version of nix

Following this documentation (multi-user nix upgrade on non-nixos (here, Arch)):
https://nix.dev/manual/nix/2.23/installation/upgrading

Typing the following command (as root):

nix-env --install --file '<nixpkgs>' --attr nix cacert -I nixpkgs=channel:nixpkgs-unstable        

Outputs the folllowing:

replacing old 'nix-2.18.5'
replacing old 'nss-cacert-3.101'
installing 'nix-2.18.5'
installing 'nss-cacert-3.101'

so it installs a very old version of Nix.
Why is that?
Thanks for your help.

NB: I have tried running nix-channel --update but that doesn’t change anything.

That is the default version on nixpkgs, you are looking for --attr nixVersions.latest

1 Like