How to upgrade from 18.03 to 18.09?

I noticed that 18.09 has appeared in the channel list:
https://nixos.org/channels/

I want to upgrade to this version. So I tried:

  1. add 18.09 to the channel:
    sudo nix-channel --add nixos-18.09 release nixos-18.09.2574.a7e559a5504 nixos
    then run the nixos-rebuild:
    sudo nixos-rebuild boot --upgrade
    but failed.
    It complained that nix-repl is no longer available.

What should I do to perform the upgrading? or should I wait for some time?

Several things to mention:

  1. 18.09 isn’t released yet! The channel is available because it’s been forked off and is being built by hydra, so it’s in a prerelease state. It’s not yet considered stable though. The release will be announced through various channels (including an announcement here on Discourse) once it happens.
  2. If you want to upgrade to the prerelease anyway, you should read the release notes before doing so (the same applies for when it’s released) to find out if there are any backwards-incompatible changes that affect you. Since the manual on the website is for 18.03, the current stable version, it doesn’t include the release notes for the prerelease. You can obtain the 18.09pre manual using nix build -I nixpkgs=channel:nixpkgs-18.09 '<nixpkgs/nixos/release.ninx>' manual then opening result/share/doc/index.html in your browser.
  3. nix-repl has been removed intentionally. This should be in the release notes, but isn’t yet by the looks of it. The appropriate action to take is to remove it from your config and use nix repl instead.
3 Likes

Thanks, I have upgraded to 18.09 successfully. The only unsmooth thing happened is that the user created to run lightdm seems no longer to work. So I changed to sddm, then everything is fine now.

My previous problem about nix-repl was my fault. I thought it was something wrong inside the nixos-rebuild, however, it was actually a package I installed and no longer supported.

Could you provide details? What is “the user created to run lightdm”, a user you created or is it the system-created user? Do you have logs? (Others might face a similar issue.)

Hi @samueldr , this mistake evolves as follows

  1. Originally, I used lightdm as my display manager, so that I turned on following option:
services.xserver.displayManager.lightdm.enable = true;

Which works fine before in version 18.03.

  1. Then I used
    nix-channel --add ... to switch to 18.09 and run nixos-rebuild boot to upgrade, after reboot, everything seems OK. BUT after I run the command systemctl, I find the service user@78.service failed.

After checking /etc/passwd, I know that user ID 78 corresponds to username lightdm, which failed.

  1. Then I decide to switch to sddm , so that I turned off the lightdm option and turned on
services.xserver.displayManager.sddm.enable = true;

and reboot the system. After rebooted, I checked again systemctl and find everything is OK.

  1. After I saw your reply, I decide to recover the previous failure to get more details, so I switch back to lightdm again by turn off sddm and turn on lightdm

After rebooted, I find that I cannot recover the previous failure, everything seems to be OK now!

Following is the output of
systemctl status user@78.service:

â—Ź user@78.service - User Manager for UID 78
   Loaded: loaded (/nix/store/wpcfjs9wn6nq1fy8hma177dqd3p6813h-systemd-239/example/systemd/system/user@.service; static; vendor preset: enabled)
  Drop-In: /nix/store/rhb10bpdx27s6499qpwl7im2gzgd7vgy-system-units/user@.service.d
           └─overrides.conf
   Active: inactive (dead)

Sep 12 23:03:01 curiosity systemd[1]: Stopping User Manager for UID 78...
Sep 12 23:03:01 curiosity systemd[941]: Stopped target Default.
Sep 12 23:03:01 curiosity systemd[941]: Stopped target Basic System.
Sep 12 23:03:01 curiosity systemd[941]: Stopped target Sockets.
Sep 12 23:03:01 curiosity systemd[941]: Stopped target Timers.
Sep 12 23:03:01 curiosity systemd[941]: Stopped target Paths.
Sep 12 23:03:01 curiosity systemd[941]: Reached target Shutdown.
Sep 12 23:03:01 curiosity systemd[941]: Starting Exit the Session...
Sep 12 23:03:01 curiosity systemd[946]: pam_unix(systemd-user:session): session closed for user lightdm
Sep 12 23:03:01 curiosity systemd[1]: Stopped User Manager for UID 78.

Previously It showed something was wrong, but it disappears now.

1 Like

the user@78.service service failed to start again

systemctl status user@78.service
 user@78.service - User Manager for UID 78
   Loaded: loaded (/nix/store/wpcfjs9wn6nq1fy8hma177dqd3p6813h-systemd-239/example/systemd/system/user@.service; static; vendor preset: enabled)
  Drop-In: /nix/store/vr9fgmlzchyxgk3694z04nzikpb46y5p-system-units/user@.service.d
           └─overrides.conf
   Active: failed (Result: protocol) since Mon 2018-10-01 01:45:05 CST; 1min 20s ago
  Process: 1080 ExecStart=/nix/store/wpcfjs9wn6nq1fy8hma177dqd3p6813h-systemd-239/lib/systemd/systemd --user (code=exited, status=1/FAILURE)
 Main PID: 1080 (code=exited, status=1/FAILURE)

Oct 01 01:45:05 curiosity systemd[1]: Starting User Manager for UID 78...
Oct 01 01:45:05 curiosity systemd[1]: user@78.service: Failed with result 'protocol'.
Oct 01 01:45:05 curiosity systemd[1]: Failed to start User Manager for UID 78.

And

systemctl status user-runtime-dir@78.service                                                                                                ✔  10343  01:45:42 
â—Ź user-runtime-dir@78.service - /run/user/78 mount wrapper
   Loaded: loaded (/nix/store/wpcfjs9wn6nq1fy8hma177dqd3p6813h-systemd-239/example/systemd/system/user-runtime-dir@.service; static; vendor preset: enabled)
  Drop-In: /nix/store/vr9fgmlzchyxgk3694z04nzikpb46y5p-system-units/user-runtime-dir@.service.d
           └─overrides.conf
   Active: failed (Result: exit-code) since Mon 2018-10-01 01:45:05 CST; 49s ago
  Process: 1086 ExecStop=/nix/store/wpcfjs9wn6nq1fy8hma177dqd3p6813h-systemd-239/lib/systemd/systemd-user-runtime-dir stop 78 (code=exited, status=1/FAILURE)
  Process: 1079 ExecStart=/nix/store/wpcfjs9wn6nq1fy8hma177dqd3p6813h-systemd-239/lib/systemd/systemd-user-runtime-dir start 78 (code=killed, signal=TERM)
 Main PID: 1079 (code=killed, signal=TERM)

Oct 01 01:45:05 curiosity systemd[1]: Started /run/user/78 mount wrapper.
Oct 01 01:45:05 curiosity systemd[1]: user-runtime-dir@78.service: Unit not needed anymore. Stopping.
Oct 01 01:45:05 curiosity systemd[1]: Stopping /run/user/78 mount wrapper...
Oct 01 01:45:05 curiosity systemd-user-runtime-dir[1086]: Failed to remove runtime directory /run/user/78 (before unmounting): No such file or directory
Oct 01 01:45:05 curiosity systemd-user-runtime-dir[1086]: Failed to remove runtime directory /run/user/78 (after unmounting): No such file or directory
Oct 01 01:45:05 curiosity systemd[1]: user-runtime-dir@78.service: Control process exited, code=exited status=1
Oct 01 01:45:05 curiosity systemd[1]: user-runtime-dir@78.service: Failed with result 'exit-code'.
Oct 01 01:45:05 curiosity systemd[1]: Stopped /run/user/78 mount wrapper.

where the user of UID 78 is lightdm according to /etc/passwd