I'm new to WSL2-Ubuntu. My computer already had preisntalled the 20.04 version, but I saw there's already the 22.04 version, so I was wondering if it was worthy to have the new one. If so, how can I upgrade it?
6 Answers
Short-answer:
In general, the process for upgrading Ubuntu on WSL is pretty much the same as from a "normal" Ubuntu CLI now:
sudo apt update && sudo apt full-upgrade
# restart Ubuntu
sudo do-release-upgrade
Explanation:
Side-note: I recommending reading this question and my answer for some background information about why the Microsoft Store version won't upgrade an existing Ubuntu/WSL release.
if it was worthy to have the new one
Since it's a brand new install anyway, I'd recommend going ahead and upgrading now, yes. Several reasons:
While no release is ever "perfect", 22.04 has been out for long enough now to reach the 22.04.1 milestone. That's important, because Canonical always waits for the first point release to move an LTS release into the "stable" channel. Prior to that, even though 22.04 was released in April, it was still considered a "development" release.
Eventually, you'll need to upgrade anyway. That "eventually" may be a long time down the road, since 20.04 will be supported for almost 3 more years, but you'll ultimately get 2 more years of support (from today) on 22.04 than you will on 20.04.
It's always easier to upgrade when you have fewer packages (especially anything from a PPA) on the system. Ubuntu upgrades are typically fairly painless, but the more you have installed, the more chance (even if still small) that something will require manual intervention on your part.
So yes, it's a good idea to go ahead and upgrade.
if so, how can I upgrade it?
There are two ways to go about this:
Delete and reinstall
First, if you really haven't starting using it yet, and are willing to just "delete and reinstall", you can go ahead and directly install 22.04. At some point, I would expect that the "Ubuntu" in the Store will move to 22.04, but as mentioned in the linked post, you still won't be able to use it to "upgrade" an existing distribution. For that reason, at least for the moment, use the "Ubuntu 22.04" release in the Store:
To remove the existing distribution (of course, this is a destructive operation -- All data inside Ubuntu will be remove), from PowerShell:
wsl -l -v # Confirm the distribution name and adjust below if needed wsl --unregister Ubuntu
Then install or upgrade the "Ubuntu 22.04" release from the Microsoft Store.
After installing from the Store, you can either launch it, or from PowerShell:
ubuntu2204.exe install --ui=none
Thank you @Blair, for pointing out in this answer the error in my previous instructions. And thank you @r4v3n6, for pointing out in a comment on this answer that I made yet another stupid mistake when attempting to fix the first error.
This will take a few seconds, ask for your username and password, and complete. Your Ubuntu distribution under WSL should now be 22.04.
"Normal" 22.04 upgrade from 20.04
Set aside several hours where you won't need WSL. LTS upgrades takes a while.
First, make sure your 20.04 installation is up-to-date:
sudo apt update && sudo apt full-upgrade
Close down Ubuntu on WSL, and from PowerShell:
wsl -l -v # Confirm the distribution name and adjust below if needed wsl --terminate Ubuntu
Restart Ubuntu and:
sudo do-release-upgrade
There will be some user interaction required fairly early in the upgrade, IIRC. When complete, exit the upgrade screen session, restart Ubuntu again as above, and you should be good-to-go.
Note: Several prior versions required that you remove the
snapd
package before upgrading. In several tests now on my own distributions, this no longer appears to be necessary for the 20.04 -> 22.04 upgrade. If you do get an error when upgrading, however, it might be useful to trysudo apt remove snapd
and then try again.
After upgrading (for either method)
After upgrading, there are a few "annoyances" in 22.04 when running on WSL that you can easily correct. See:
- landscape-sysinfo.cache: Permission denied when I start Ubuntu 22.04 in WSL
- Ubuntu 22.04 LTS on WSL: "Failed to retrieve available kernel versions"/"Failed to check for ...
I can't recall if either or both of these are present after an upgrade, but I know they are in the "stock" 22.04 WSL install.

- 17,888
I followed @NotTheDroid's answer, which helped (and was appreciated), but didn't completely work. Many thanks - appreciate the post, but perhaps the process changed after some update? After following them, I ended up with Ubuntu 20.04 instead of Ubuntu 22.04.2
I selected "Ubuntu 22.04.2 LTS" from the MS store, but after following the steps as written, ended up with Ubuntu 20.04 again.
Only when I:
Again deleted the Ubuntu installation from WSL as described in Step 1
Disregarded this part from Step 2:
I recommend that you do not click "Open" after installing from the Store.'
Instead of Step 3, used the Open option in the Microsoft Store to install did I actually get Ubuntu 22.04.

- 17,888

- 71
-
Welcome to Ask Ubuntu! Thank you for pointing out the typo - I've fixed it. Note that, in the future, if you spot typos like this, you can Edit the post. As a new user, I believe you'll need to change at least 6 characters, though, so try to find something else that can be harmlessly edited to get the typo through. After approval, edits to existing posts will get you 2 rep on the site. I definitely would have approved the edit ;-) – NotTheDr01ds Apr 20 '23 at 22:26
-
So here's the thing - At first glance, I do think you identified an error in my post -- The command should have been
ubuntu2004.exe
, notubuntu.exe
. I'm not sure how the heck it got 74 upvotes without someone pointing that out yet, so thank you! My instructions on not clicking "Open" are a bit outdated, so perhaps folks have just been using that anyway. – NotTheDr01ds Apr 20 '23 at 22:38
WSL2 install multiple Ubuntu instances
This is another option in addition to the regular upgrade approach mentioned at: https://askubuntu.com/a/1428481/52975 and can be useful if you want to keep both Ubuntus around.
List all distros that you can install from a Command Prompt:
wsl --list --online
The list contained the desired Ubuntu-22.04
, so we can install it with:
wsl --install -d Ubuntu-22.04
It is also possible to install it on a GUI with the Windows Store, just search for "Ubuntu 22.04" and pick the Canonical provided item.
To get a shell into the newly installed Ubuntu-22.04
container run:
wsl -d Ubuntu-22.04
or to set it as the default container:
wsl --setdefault Ubuntu-22.04
after which running just:
wsl
will use Ubuntu-22.04
by default.
Related: https://stackoverflow.com/questions/51584765/how-do-you-install-multiple-separate-instances-of-ubuntu-in-wsl For multiple instances of the same distro version it is a bit more annoying, but possible with --export
.

- 28,474
step1:
sudo vim /etc/update-manager/release-upgrades
Make sure Prompt=lts in the bottom line. If it is normal or never, no update will be detected. If it is lts, use:wq to save and exit.
step2:
Upgrade system components and check for software updates
sudo apt update
Update software
sudo apt upgrade -y
Update release version
sudo do-release-upgrade

- 11
Warning! The following will put you at 24.04!
I'm new here so I can't just comment on @NotTheDroid's fantastic answer. After following the steps the installation failed somewhere along the way. When WSL restarted I was still at 20.04. Retracing my steps only produced the following message:
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.
I found two key excellent instructions that got me past this and kept me in the development version with all my configurations intact. Source: https://dev.to/equiman/upgrade-ubuntu-version-on-wsl-3h10
After these commands:
sudo apt update
sudo apt list --upgradable
sudo apt upgrade -y
Run sudo apt install update-manager-core
Then sudo do-release-upgrade -d
Note the '-d' as the subtle difference from instructions in other answers.
I also appreciated the source's instructions to backup before the upgrade. Probably a good idea.
-
Failed to mention this brought me to 24.04. Helpful command to check version:
lsb_release -a
– Spencer Williamson Nov 16 '23 at 16:18
Just install from MS shop. It should (at least in my case it did) upgrade from 20.04 to 22.04.

- 93
-
I just don't see how that could possibly have worked. See this question for why. Can you perhaps provide more details on the exact steps you took to clarify? – NotTheDr01ds Sep 09 '22 at 11:55
-
Well it did. You can, if you wish so do: sudo apt update, sudo apt upgrade sudo apt dist-upgrade and then sudo do-release-upgrade. If it doesn't upgrade ediit /etc/update-manager/release-upgrades and change LTS or never to normal (instructions in file). re-run. It will upgrade. – Sami Hulkko Sep 09 '22 at 15:27
sudo apt remove snapd
was key for me. Before what I would just get a useless "Aborted" error. – jessehouwing Oct 23 '22 at 13:40sudo dist-upgrade
– CervEd Dec 05 '22 at 13:44apt
commands anddo-release-upgrade
worked for me on my very heavily used and configured 20.04. Now I'm on 22.04. This was very easy. I'm not sure I understand the reasoning behind the other method(s). – Vince May 07 '23 at 10:58do-release-upgrade
said I was already on the latest LTS version. This answer helped me get 23.04 https://askubuntu.com/a/1492910/1297632 – Daniel Kaplan Dec 19 '23 at 03:10