WRITELOOP

UPGRADE NIXOS TO NEXT VERSION

Recently I had to update my NixOS lab VM from 2023-05 to 202311. Here are the steps required to do that.

2023 December 4

To upgrade between NixOS versions, we need to login or become root and add the channel for the new version.

Important: Channels are set per user. That means that running nix-channel --add as a non root user (or without sudo) will not affect configuration in /etc/nixos/configuration.nix. So, to upgrade, you need to login as root or become root with sudo.

  • To see which NixOS channel version you’re subscribed to, run the following as root:

nix-channel --list | grep nixos
  • To update nixos version (e.g. 2023-05 to 2023-11) - run as root:

nix-channel --add https://channels.nixos.org/nixos-23.11 nixos && \
    nixos-rebuild switch --upgrade

Then, reboot the machine. After the reboot, check again the NixOS channel version:


nix-channel --list | grep nixos

It must be the new one.

TAGS