Score:1

do-release-upgrade runs a bit and then hangs on WSL2

so flag

My WSL2 currently has a single distribution - Ubuntu 18.04. I wish to upgrade it in place to the latest and so I ran the steps described in https://www.nextofwindows.com/how-to-upgrade-existing-wsl-wsl2-ubuntu-18-04-to-20-04, namely:

sudo apt update
sudo apt list --upgradable
sudo apt upgrade
sudo apt --purge autoremove
sudo apt install update-manager-core
sudo do-release-upgrade

For the last step I had to follow the instructions in https://askubuntu.com/a/1296373/611551, namely to link /usr/lib/ssl/cert.pem to /etc/ssl/certs/ca-certificates.crt, but it finally runs, only it fails short afterwards:

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Hit http://archive.ubuntu.com/ubuntu bionic InRelease
Hit http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit https://download.docker.com/linux/ubuntu bionic InRelease
Hit http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease
Fetched 0 B in 0s (0 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done

Restoring original system state

Aborting
Reading package lists... Done
Building dependency tree
Reading state information... Done
=== Command terminated with exit status 1 (Thu Oct  6 16:35:52 2022) ===

And it hangs. At this point I have no choice but aborting it. Retrying does not help.

What am I doing wrong?

NotTheDr01ds avatar
vn flag
I do keep an eye out for WSL questions here on Ask Ubuntu, but I usually look for the [tag:windows-subsystem-for-linux] tag. Did you resolve the issue (and if so, suggest posting an answer). If not, I've added an answer below - I thought there was a duplicate for this, but I can't find it now.
Score:0
vn flag

In my experience, this is often caused in older release upgrades by the presence of the snapd package and the lack of Systemd support in WSL. Before running sudo do-release-upgrade, try:

sudo apt remove snapd

Hopefully the upgrade will proceed as expected.

mark avatar
so flag
That seems to have helped. Thank you.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.