I am on WSL2 and had/have Ubuntu 18.04 installed. I went through a couple of steps to upgrade versions (enabling systemd, creating a symbolic link for apt-pkg, etc.). I was finally able to run sudo do-release-upgrade
successfully and cat /etc/lsb-release
currently returns 22.04.1 LTS
.
However, my terminal, VS Code, and wsl.exe are all still showing version 18.04. How do I fix this so I'm only using 22.04.1?
$ cat /etc/lsb-release
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
$ wsl.exe -l --all
Windows Subsystem for Linux Distributions:
Ubuntu-18.04 (Default)
docker-desktop
docker-desktop-data
$ wsl --status
Default Distribution: Ubuntu-18.04
Default Version: 2
I was following instructions here and running these commands or variations of them:
$ sudo apt update
$ sudo apt upgrade -y
> wsl --shutdown
$ sudo apt --purge autoremove
$ sudo apt install update-manager-core -y
$ sudo do-release-upgrade
I also ran the following command from here when I wasn't able to run reboot
(before realizing I should just use wsl --shutdown
in Powershell):
cd /mnt/c/ && cmd.exe /c start "rebooting WSL" cmd /c "timeout 5 && wsl -d $WSL_DISTRO_NAME" && wsl.exe --terminate $WSL_DISTRO_NAME
I was getting an error saying "No module found named 'apt-pkg'", so I followed instructions here. That then gave me command not found
error for do-release-upgrade
, but I fixed that with this info.
I finally fixed the apt-pkg error by creating a symbolic link as described here so Ubuntu was directed towards python 3.6 instead of a more recent version.
I was then getting this error message when trying to run sudo do-release-upgrade
:
A problem occurred during the update. This is usually some sort of network problem, please check your network connection and retry.
Err https://packages.cloud.google.com/apt cloud-sdk InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05
I fixed that error by running curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
I was then finally able to run sudo do-upgrade-release
, but at the very end it prompts to reboot, so I wasn't able to do that in the same session and ended up just restarting my computer, hoping that would do the trick. It didn't (seem to at least)--I was still seeing Ubuntu 18.04. I hadn't run cat /etc/lsb-release
yet, so I don't know if it had updated there or not. Because I was still seeing 18.04 in the terminal and VSCode, I basically just started running variations of apt update/upgrade
and do-release-upgrade
, so it's quite possible I upgraded twice without realizing it.
Please let me know if any other info is needed.
release-upgrade
to work are needed (especially since you can't update directly from 18.04 to 22.04, only to 20.04 which is the next LTS release after 18.04, so did youdo-release-upgrade
twice?) – Esther Jan 17 '23 at 19:38cat /etc/lsb-release
as well? If so, then I'm wondering if you might have more than one distribution installed. Can you add the output ofwsl.exe -l -v
to your question? Thanks! – NotTheDr01ds Jan 17 '23 at 20:32@
symbol before a name will make sure that that person is notified of your reply. I didn't see yours until I rechecked the question manually. You, on the other hand, should receive notification for all comments on your own post. – NotTheDr01ds Jan 19 '23 at 20:04