[Bug 2080233] Re: [wsl] do-release-upgrade fails with systemd disabled

DEXTER 2080233 at bugs.launchpad.net
Mon Sep 16 11:33:22 UTC 2024


I've upgraded my WSL1 from Jammy to Noble with do-release-upgrade, and
now it is a completely broken state, because of probably this:

root at DESKTOP:~# apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  bolt fwupd-signed libatasmart4 libblockdev-crypto2 libblockdev-fs2 libblockdev-loop2 libblockdev-part-err2 libblockdev-part2 libblockdev-swap2 libblockdev-utils2 libblockdev2 libflashrom1 libftdi1-2 libllvm13 libmbim-glib4 libmbim-proxy libmm-glib0 libnsl-dev libqmi-glib5
  libqmi-proxy libsmbios-c2 libtcl8.6 libtirpc-dev libudisks2-0 libunistring5 libvolume-key1 libvulkan1 mesa-vulkan-drivers modemmanager sbsigntool secureboot-db tcl tcl8.6 udisks2 usb-modeswitch usb-modeswitch-data
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libssl-dev systemd-sysv
Suggested packages:
  libssl-doc
The following packages will be upgraded:
  libssl-dev systemd-sysv
2 upgraded, 0 newly installed, 0 to remove and 722 not upgraded.
5 not fully installed or removed.
Need to get 0 B/2,419 kB of archives.
After this operation, 846 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up systemd (255.4-1ubuntu8.4) ...
Failed to take /etc/passwd lock: Invalid argument
dpkg: error processing package systemd (--configure):
 installed systemd package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 systemd
E: Sub-process /usr/bin/dpkg returned an error code (1)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubuntu-release-upgrader in
Ubuntu.
https://bugs.launchpad.net/bugs/2080233

Title:
  [wsl] do-release-upgrade fails with systemd disabled

Status in ubuntu-release-upgrader package in Ubuntu:
  New

Bug description:
  Original report: https://github.com/ubuntu/WSL/issues/493

  On WSL, systemd is not always enabled. This is the case on WSL1 where
  it cannot be enabled and on WSL2 when it's been disabled or not
  enabled by default.

  When systemd is not available do-release-upgrade fails with the error
  below and upgrade is cancelled:

  From the report 
  ===
  Traceback (most recent call last):
    File "/tmp/ubuntu-release-upgrader-uqmd8iby/noble", line 8, in <module>
      sys.exit(main())
    File "/tmp/ubuntu-release-upgrader-uqmd8iby/DistUpgrade/DistUpgradeMain.py", line 241, in main
      if app.run():
    File "/tmp/ubuntu-release-upgrader-uqmd8iby/DistUpgrade/DistUpgradeController.py", line 2642, in run
      return self.fullUpgrade()
    File "/tmp/ubuntu-release-upgrader-uqmd8iby/DistUpgrade/DistUpgradeController.py", line 2447, in fullUpgrade
      if not self.doPostInitialUpdate():
    File "/tmp/ubuntu-release-upgrader-uqmd8iby/DistUpgrade/DistUpgradeController.py", line 1438, in doPostInitialUpdate
      self.quirks.run("PostInitialUpdate")
    File "/tmp/ubuntu-release-upgrader-uqmd8iby/DistUpgrade/DistUpgradeQuirks.py", line 102, in run
      func()
    File "/tmp/ubuntu-release-upgrader-uqmd8iby/DistUpgrade/DistUpgradeQuirks.py", line 127, in noblePostInitialUpdate
      self._test_and_fail_on_tpm_fde()
    File "/tmp/ubuntu-release-upgrader-uqmd8iby/DistUpgrade/DistUpgradeQuirks.py", line 1898, in _test_and_fail_on_tpm_fde
      snap_list = subprocess.check_output(['snap', 'list'])
    File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "/usr/lib/python3.10/subprocess.py", line 526, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['snap', 'list']' returned non-zero exit status 1.
  """

  This error should be ignored when systemd is not running.

  Read https://github.com/ubuntu/WSL/issues/493#issuecomment-2324510606
  for details. Thanks to Vadim for the investigation.

  """
  In /tmp/ubuntu-release-upgrader-t8sg0mg9/DistUpgrade/DistUpgradeQuirks.py:

       def _test_and_fail_on_tpm_fde(self):
          """
          LP: #2065229
          """
          try:
              snap_list = subprocess.check_output(['snap', 'list'])
              snaps = [s.decode().split()[0] for s in snap_list.splitlines()]
          except FileNotFoundError:
              # snapd not installed?
              return
  I think except FileNotFoundError: should be extended to except:

  Because DistUpgradeQuirks.py is stored in some temp directory, it was hard to change it inplace, but I succeeded, and then the upgrade process continued as it should
  ===

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/2080233/+subscriptions




More information about the foundations-bugs mailing list