-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nix upgrade-nix
does not detect 2.4
#5503
Comments
Is it possibly related to the fact that I run my Nix single-user and it's no longer supported in v2.4? https://github.com/NixOS/nix/blob/2.4-maintenance/scripts/install-nix-from-closure.sh#L63 If so, I think it should be mentioned in release notes...? |
No. Upgrade pulls the latest version from a file in nixpkgs (which still indicates 2.3.16). I am not sure exactly what the criteria for updating it is, but I assume this is waiting for nixpkgs itself to complete updating (see NixOS/nixpkgs#144197). |
@abathur does it mean that the best workaround for now is to just reinstall Nix from scratch? |
I would personally treat that as a last resort, if you need exactly the same version. (uninstall/reinstall experience has sharp corners and can be frustrating). Nixpkgs also includes a nixUnstable attr (also known as nixFlakes) which should be a pre-2.5 build that isn't too far ahead of 2.4 at this point. I haven't tried using this via nix-env, but if the wiki page for flakes is right, something like |
The nixpkgs PR I mentioned before has been merged--this should work now. |
I can confirm that this works now: [user@pc zsh]$ nix --version
nix (Nix) 2.4pre20210429_d15a196
[user@pc zsh]$ nix upgrade
error: 'upgrade' is not a recognised command
Try 'nix --help' for more information.
[user@pc zsh]$ nix --help
[user@pc zsh]$ nix-channel --update
unpacking channels...
[user@pc zsh]$ nix upgrade-nix
replacing old 'nix-2.4pre20210429_d15a196'
installing 'nix-2.11.0'
building '/nix/store/lyrzv64mi81lj04fh0qjg6vx5xbqmm6i-user-environment.drv'...
[user@pc zsh]$ nix --version
nix (Nix) 2.11.0
[user@pc zsh]$ |
Describe the bug
My collegaue has problems with remote builds using Nix 2.4. To see if it's a matter of different Nix version (I use 2.3 myself), I wanted to upgrade. However, I'm not sure how to do this.
Steps To Reproduce
nix-channel --update
, thennix upgrade-nix
.Expected behavior
According to --help, it should
upgrade Nix to the latest stable version
. Latest stable version is 2.4, but I get this output instead:nix-env --version
output2.3.16, as mentioned above.
Additional context
I also tried to upgrade using
nix-env -u
and it managed to upgrade tonix-2.4pre-rc1
. Then, after runningnix upgrade-nix
, it downgraded to 2.3:OS: macOS Big Sur 11.3.1
The text was updated successfully, but these errors were encountered: