Skip to content

Upgrading from 21.11 to unstable fails due to systemd being newer in 21.11 #152795

@brandonweeks

Description

@brandonweeks

Describe the bug

Upgrading fails, seemingly because the existing systemd version is newer in 21.11 than unstable.

[bweeks@nixos:~]$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
updating systemd-boot from (249.7) to (249.5)
Skipping "/boot/EFI/systemd/systemd-bootx64.efi", since a newer boot loader version exists already.
Skipping "/boot/EFI/BOOT/BOOTX64.EFI", since a newer boot loader version exists already.
Traceback (most recent call last):
  File "/nix/store/4d48b4f5vhskn9qrnd13mpcygpcjh0h4-systemd-boot", line 314, in <module>
    main()
  File "/nix/store/4d48b4f5vhskn9qrnd13mpcygpcjh0h4-systemd-boot", line 267, in main
    subprocess.check_call(["/nix/store/n7shnc1xmriya9djkcvzibw9f6paahxy-systemd-249.5/bin/bootctl", "--path=/boot", "update"])
  File "/nix/store/rppr9s436950i1dlzknbmz40m2xqqnxc-python3-3.9.9/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/nix/store/n7shnc1xmriya9djkcvzibw9f6paahxy-systemd-249.5/bin/bootctl', '--path=/boot', 'update']' returned non-zero exit status 1.
warning: error(s) occurred while switching to the new configuration

[bweeks@nixos:~]$ 

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install NixOS 21.11
  2. Remove 21.11 channel, add unstable channel
  3. Run nixos-rebuild switch

Expected behavior

NixOS upgrades from 21.11 to unstable.

Additional context

84a769c is the commit upgrading systemd to 249.7, 50d0279 cherry picks it to 21.11.

Adding the --graceful flag to the bootctl update invocation would also solve this issue, albeit leaving the newer EFI files in place.

[nix-shell:~]$ sudo bootctl --path=/boot --graceful update
Skipping "/boot/EFI/systemd/systemd-bootx64.efi", since a newer boot loader version exists already.
Skipping "/boot/EFI/BOOT/BOOTX64.EFI", since a newer boot loader version exists already.

Notify maintainers

@andir @edolstra @flokli @kloenk

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[bweeks@nixos:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.10-hardened1, NixOS, 21.11 (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.16`
 - channels(root): `"nixos-22.05pre341453.ac169ec6371"`
 - channels(bweeks): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions