Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to update from 23.10 to 24.04 on WSL2, by 2024.6.13 #11694

Closed
1 of 2 tasks
blue-cat-whale opened this issue Jun 14, 2024 · 7 comments
Closed
1 of 2 tasks

Failed to update from 23.10 to 24.04 on WSL2, by 2024.6.13 #11694

blue-cat-whale opened this issue Jun 14, 2024 · 7 comments

Comments

@blue-cat-whale
Copy link

Windows Version

10.0.22631.3737

WSL Version

0.0.0.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.10.16.3-microsoft-standard-WSL2

Distro Version

23.10

Other Software

N/A

Repro Steps

Step 1: sudo do-release-upgrade
Step 2: sudo systemctl restart snapd.service
Step 3: sudo service snapd start
Step 4: sudo service snapd.service start

Expected Behavior

I expect to see a successful update

Actual Behavior

Result of Step 1:

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Hit http://mirrors.aliyun.com/ubuntu mantic InRelease
Hit http://mirrors.aliyun.com/ubuntu mantic-security InRelease
Hit http://mirrors.aliyun.com/ubuntu mantic-updates InRelease
Hit http://mirrors.aliyun.com/ubuntu mantic-proposed InRelease
Hit http://mirrors.aliyun.com/ubuntu mantic-backports InRelease
Hit http://archive.ubuntu.com/ubuntu mantic InRelease
Hit http://archive.ubuntu.com/ubuntu mantic-backports InRelease
Hit http://security.ubuntu.com/ubuntu mantic-security InRelease
Fetched 0 B in 0s (0 B/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
error: cannot list snaps: cannot communicate with server: Get "http://localhost/v2/snaps": dial unix /run/snapd.socket: connect: no such file or directory

Error in sys.excepthook:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-tx6qhtkv/DistUpgrade/DistUpgradeViewText.py", line 138, in _handleException
    apport_crash(type, value, tb)
  File "/tmp/ubuntu-release-upgrader-tx6qhtkv/DistUpgrade/DistUpgradeApport.py", line 57, in apport_crash
    apport_excepthook(type, value, tb)
TypeError: apport_excepthook() missing 1 required positional argument: 'exc_tb'

Original exception was:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-tx6qhtkv/noble", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/tmp/ubuntu-release-upgrader-tx6qhtkv/DistUpgrade/DistUpgradeMain.py", line 241, in main
    if app.run():
       ^^^^^^^^^
  File "/tmp/ubuntu-release-upgrader-tx6qhtkv/DistUpgrade/DistUpgradeController.py", line 2607, in run
    return self.fullUpgrade()
           ^^^^^^^^^^^^^^^^^^
  File "/tmp/ubuntu-release-upgrader-tx6qhtkv/DistUpgrade/DistUpgradeController.py", line 2412, in fullUpgrade
    if not self.doPostInitialUpdate():
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/ubuntu-release-upgrader-tx6qhtkv/DistUpgrade/DistUpgradeController.py", line 1437, in doPostInitialUpdate
    self.quirks.run("PostInitialUpdate")
  File "/tmp/ubuntu-release-upgrader-tx6qhtkv/DistUpgrade/DistUpgradeQuirks.py", line 102, in run
    func()
  File "/tmp/ubuntu-release-upgrader-tx6qhtkv/DistUpgrade/DistUpgradeQuirks.py", line 128, in noblePostInitialUpdate
    self._test_and_fail_on_tpm_fde()
  File "/tmp/ubuntu-release-upgrader-tx6qhtkv/DistUpgrade/DistUpgradeQuirks.py", line 1910, in _test_and_fail_on_tpm_fde
    snap_list = subprocess.check_output(['snap', 'list'])
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['snap', 'list']' returned non-zero exit status 1.

Result of step 2:

System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

Result of step 3:

snapd: unrecognized service

Result of step 4:

snapd.service: unrecognized service

Diagnostic Logs

N/A

Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@jgregoire
Copy link

Having same issue. I tried reinstalling snapd. $ snap list hangs for a long time.

I do not use any snaps, so I ran $ sudo apt remove snapd then $ sudo do-release-upgrade and was successful.

@mforkel
Copy link

mforkel commented Jul 7, 2024

An alternative to removing snapd is to enable systemd in the distribution, see https://learn.microsoft.com/en-us/windows/wsl/systemd

@westfly
Copy link

westfly commented Sep 23, 2024

Having same issue. I tried reinstalling snapd. $ snap list hangs for a long time.

I do not use any snaps, so I ran $ sudo apt remove snapd then $ sudo do-release-upgrade and was successful.

remove snapd

sudo apt remove snapd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'snapd' is not installed, so not removed
The following package was automatically installed and is no longer required:
  squashfs-tools
Use 'sudo apt autoremove' to remove it.
E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success
E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success

but still do-release-upgrade fail and can't update anymore

apt-get check
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libnss-systemd : Depends: systemd (= 253.5-1ubuntu6.1) but 255.4-1ubuntu8.4 is installed
 libpam-systemd : Depends: systemd (= 253.5-1ubuntu6.1) but 255.4-1ubuntu8.4 is installed
 mailutils : Depends: libmailutils9t64 but it is not installable
 parted : Depends: libparted2t64 (= 3.6-4build1) but it is not installable
 systemd-sysv : Depends: systemd (= 253.5-1ubuntu6.1) but 255.4-1ubuntu8.4 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

some solution below don't work

sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get install -f 

@westfly
Copy link

westfly commented Sep 26, 2024

Having same issue. I tried reinstalling snapd. $ snap list hangs for a long time.
I do not use any snaps, so I ran $ sudo apt remove snapd then $ sudo do-release-upgrade and was successful.

remove snapd

sudo apt remove snapd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'snapd' is not installed, so not removed
The following package was automatically installed and is no longer required:
  squashfs-tools
Use 'sudo apt autoremove' to remove it.
E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success
E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success

but still do-release-upgrade fail and can't update anymore

apt-get check
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libnss-systemd : Depends: systemd (= 253.5-1ubuntu6.1) but 255.4-1ubuntu8.4 is installed
 libpam-systemd : Depends: systemd (= 253.5-1ubuntu6.1) but 255.4-1ubuntu8.4 is installed
 mailutils : Depends: libmailutils9t64 but it is not installable
 parted : Depends: libparted2t64 (= 3.6-4build1) but it is not installable
 systemd-sysv : Depends: systemd (= 253.5-1ubuntu6.1) but 255.4-1ubuntu8.4 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

some solution below don't work

sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get install -f 

install deb package version by force which wget from https://ubuntu.pkgs.org/24.04/ubuntu-main-amd64

sudo dpkg -i  libmailutils9t64_3.17-1.1build3_amd64.deb  \
                      libpam-systemd_255.4-1ubuntu8.4_amd64.deb  \
                      libnss-systemd_255.4-1ubuntu8.4_amd64.deb  \
                      libparted2t64_3.6-4build1_amd64.deb  

@bibaodi
Copy link

bibaodi commented Nov 2, 2024

remove snapd, work for me.

@wermos
Copy link

wermos commented Nov 23, 2024

I was facing the same issue and removing snapd using sudo apt remove snapd worked for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants