28

I'm using WSL2 on Windows 11, store already has latest 24.04 version but I can't upgrade mine from 22:04. I've tried rebooting WSL, nothing worked. Has anyone went through this already?

Attaching snippet of my attempt bellow:

sudo apt update && sudo apt full-upgrade && sudo do-release-upgrade

Hit:1 https://apt.releases.hashicorp.com jammy InRelease
Hit:2 https://download.docker.com/linux/ubuntu jammy InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:6 https://ppa.launchpadcontent.net/fish-shell/release-3/ubuntu jammy InRelease
Hit:3 https://prod-cdn.packages.k8s.io/repositories/isv:/kubernetes:/core:/stable:/v1.30/deb  InRelease
Hit:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release
set Prompt=normal in /etc/update-manager/release-upgrades.
Daniel
  • 383

5 Answers5

26

I found the answer in another question. Removing snapd worked like a charm.

sudo apt remove snapd
dnbrv
  • 361
10

For me the solution was to switch update manager to the normal channel, update to 23.10, get snapd running by booting wsl with systemd, and then doing the "sudo do-release-upgrade". It seems the "do-release-upgrade" has a dependency on snapd running, which requires systemd.

To change update manager to the normal channel, edit sudo vim /etc/update-manager/release-upgrades and modify the lts value to normal

sudo nano /etc/update-manager/release-upgrades

To enable systemd, create the following file at /etc/wsl.conf (edit with sudo)

[boot]
systemd=true

Save the file, exit out of wsl. Make sure wsl is stopped with "wsl --shutdown" from a windows command prompt. Then make sure you're running the latest wsl with "wsl --update".

Then open an ubuntu prompt again and confirm systemd is running with:

ps -ef | grep systemd

You should see some processes. Confirm snapd is running by checking the service status with systemctl:

systemctl status snapd.service

If it's not active, enable it, or if it doesn't exist, install snapd via apt.

Once snapd is running, you can upgrade to 24.04 with "sudo do-release-upgrade".

Once the upgrade is successful, you can remove the /etc/wsl.conf file and restart wsl if you do not want to run Ubuntu WSL with systemd (it's a little lighter weight without it, if you don't need certain services such as snapd).

peabody
  • 201
5

I'm using WSL2 on Windows 11 (23h2, home), and upgraded my Ubuntu from 22.04 to 24.04 through 23.10, but I want to point out that the upgrade was not successful for me because I got a problem - Ubuntu cause hang of my system. CPU and memory utilization is fine, but any simple Windows apps take about 4-5 minutes to launch with long freezes\hangs. Also typing any command into the bash terminal (in upgraded Ubuntu 24.04) gave a response only after ~2 minutes.

I completely uninstalled Ubuntu and completely disabled WSL components, then turned WSL back on and installed Ubuntu 24.04 from the Microsoft Store, but this problem happened again and again. Then I completely uninstalled Ubuntu 24.04, restarted WSL and installed Ubuntu 22.04 back, and there is no problem here. I don't know what's wrong, I have a clean Win 11 (2 weeks after installation, all updates installed, etc.), and this is the reaction to Ubuntu 24.04... I think may be 24.04 is still raw for wsl... I really wish I had backed up of my prev 22.04 stable system.

Same thing from another user: https://github.com/microsoft/WSL/issues/11522

4

For me, I updated from 22.04 to 23.10, then from 23.10 to 24.04.

You can try to follow the output, set Prompt=normal in /etc/update-manager/release-upgrades, and then sudo do-release-upgrade to Ubuntu 23.10, finally sudo do-release-upgrade -d to Ubuntu 24.04.

anf4108
  • 41
2

The upgrade path is not open due to BLOCKER bugs.

You can read more in this answer to the similar question about Kubuntu.

zma
  • 21