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

[WSL1] Upgrade to Ubuntu 24.04 from 22.04 fails with missing snap. Possible to work around? #11982

Open
1 of 2 tasks
vadimkantorov opened this issue Aug 30, 2024 · 4 comments
Open
1 of 2 tasks

Comments

@vadimkantorov
Copy link

Windows Version

Microsoft Windows [Version 10.0.22631.4037]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.153.1-2

Distro Version

Ubuntu 22.04

Other Software

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.4037

Repro Steps

sudo do-release-upgrade

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.

Expected Behavior

Ubuntu 24.04 installs in one way or another

Actual Behavior

Complete breakage as it seems to depend on snap list which prints this:

Interacting with snapd is not yet supported on Windows Subsystem for Linux 1.
This command has been left available for documentation purposes only.

I would propose at least snap list prints an empty list or something else reasonable.

Is it possible to upgrade to Ubuntu 24.04 in some other way to bypass snap problems?

I like WSLv1 on my Laptop because it's fast, lightweight and doesn't require Hyper-V or a full VM and uses the regular processes without a separate memory allocated for the VM.

Diagnostic Logs

No response

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 script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

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.

@zcobol
Copy link

zcobol commented Aug 31, 2024

snap needs systemd and wsl1 doesn't support it.

@vadimkantorov
Copy link
Author

vadimkantorov commented Sep 2, 2024

I mean, is it possible to stub out (or uninstall it) snap in such a way so that the upgrader moves on?

Maybe even snap list could return 0 exit code and print empty string?

Even if I sudo apt uninstall snap, then sudo do-release-upgrade / noble.tar.gz reinstalls it and fails while running snap list. I think a better stub of command snap list (and maybe others) is needed to proceed...

@vadimkantorov
Copy link
Author

After the hack I described in ubuntu/WSL#493, the upgrade fails with trying to run some systemd-using postinstall scripts

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

No branches or pull requests

2 participants