Ubuntu 22.04 LTS Jammy Jellyfish is the upcoming Long term version of Canonical Linux OS. However, while writing this tutorial it was still in the testing phase and set to roll out in 2022 April. Well, for those who are interested to try it out without losing their existing Ubuntu 20.04, here are the steps.
Warning: Don’t Upgrade your production system because Ubuntu 22.04 is still in the development stage. This is only for testing. And also don’t forget to backup your important data before starting the upgrading process.
Upgrade Ubuntu 20.04 LTS to Ubuntu 22.04 LTS (Jammy Jelly Fish)
Here we are using Ubuntu 20.04 Focal fossa that is running on Windows 11 or 10 WSL 2 (Windows Subsystem for Linux), however, this tutorial will also work on a normal 20.04 LTS running on a Virtual machine or PC/Laptop.
First, of all make sure all the installed software packages on your system are up to date. For this, we just need to run update & upgrade commands:
sudo apt update sudo apt upgrade
Also, run the below distribution upgrade command to get if any nearest release is available.
sudo apt dist-upgrade
Although the update manager core will already be there, however, to confirm just run the given command:
sudo apt install update-manager-core
Edit the release-upgrades configuration file using the below-given command.
sudo nano /etc/update-manager/release-upgrades
After that change the Prompt value from Normal to LTS. However, by default, it will be set to LTS.
Prompt = lts
Save the file by pressing Ctrl+O and then exit the same with Ctrl+X.
Upgrade Ubuntu 20.04 (Focal Fossa) to Ubuntu 22.04 (JellyFish)
Finally, the system is prepared to get the latest available long-term version available to install, here for Focal Fossa, it is Jelly Fish.
sudo do-release-upgrade -d
After running the above command, the system will update and replace the system repository and after that, once the system is ready to get upgraded, you will ask finally whether you want to upgrade or not. If you have changed your mind then type ‘n‘ and the system will roll back all the made changes.
Once the installation of the new Jammy Jelly Fish is completed, remove the obsolete packages to clear some space by pressing Y and hitting the Enter key.
Once done, the WSL Ubuntu App will ask you to restart the system. However, it has not been started as an init system, so that will not be possible. Therefore, simply close the WSL app window and open it again.
Check Ubuntu 22.04 WSL version
Next, a time when you start the Ubuntu WSL app, check its version to confirm you have the upgraded Ubuntu Jammy Jellyfish 22.01 LTS version (development branch).
8 thoughts on “How to Upgrade WSL 2 or 1 Ubuntu 20.04 to 22.04 LTS”
After I upgraded to Ubuntu 22.04 all windows, e.g. nautilus, has Light Theme colors (except gnome-terminal).
How do I change to default dark theme ?
seems to work in my installation.
Command line I use:
gsettings set org.gnome.desktop.interface color-scheme prefer-dark
Thanks for this instructions! The upgrade worked very well.
The described “sudo apt dist-upgrade” didn’t do anything visible for me. Therefor it did worry me for the longtime success.
Greate post. works like a charm
dist-upgrade doesn’t do anything too special; it just prioritizes getting the latest versions of dependencies for the most important programs over other programs that might have held those packages back. Basically it “prepares” your system a little more for doing the actual distribution upgrade after that.
So if the command didn’t do much, your system was basically already fine to do the upgrade.
On the last screenshot, we can see that you are on a non LTS version.
It’s a bit confusing knowing that in the tutorial, we explicitly define that we want LTS only.
Thank you for the tutorial.
Worked flawlessly for me, many thanks.
Thanks! This is very helpful.