1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

Merge pull request #12 from DeterminateSystems/update-upgrade-docs

Update upgrade docs
This commit is contained in:
Graham Christensen 2025-03-12 13:23:41 +00:00 committed by GitHub
commit f988d9edbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,34 +1,10 @@
# Upgrading Nix
> **Note**
>
> These upgrade instructions apply where Nix was installed following the [installation instructions in this manual](./index.md).
Check which Nix version will be installed, for example from one of the [release channels](http://channels.nixos.org/) such as `nixpkgs-unstable`:
You can upgrade Determinate Nix using Determinate Nixd:
```console
$ nix-shell -p nix -I nixpkgs=channel:nixpkgs-unstable --run "nix --version"
nix (Nix) 2.18.1
sudo determinate-nixd upgrade
```
> **Warning**
>
> Writing to the [local store](@docroot@/store/types/local-store.md) with a newer version of Nix, for example by building derivations with [`nix-build`](@docroot@/command-ref/nix-build.md) or [`nix-store --realise`](@docroot@/command-ref/nix-store/realise.md), may change the database schema!
> Reverting to an older version of Nix may therefore require purging the store database before it can be used.
Note that the `sudo` is necessary here and upgrading fails without it.
## Linux multi-user
```console
$ sudo su
# nix-env --install --file '<nixpkgs>' --attr nix cacert -I nixpkgs=channel:nixpkgs-unstable
# systemctl daemon-reload
# systemctl restart nix-daemon
```
## macOS multi-user
```console
$ sudo nix-env --install --file '<nixpkgs>' --attr nix cacert -I nixpkgs=channel:nixpkgs-unstable
$ sudo launchctl remove org.nixos.nix-daemon
$ sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist
```