How to Upgrade WSL 2 or 1 Ubuntu 20.04 to 22.04 LTS

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 normal 20.04 LTS running on a Virtual machine or PC/Laptop.

System Update

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

 

Install update-manager-core

Although the update manager core will already be there, however, to confirm just run the given command:

sudo apt install update-manager-core

Edit 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 to Ubuntu 20.04 (Focal Fossa) to Ubuntu 22.04 (Jelly Fish)

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.

Upgrade Ubuntu 20.04 LTS to Ubuntu 22.04 LTS Jammy Jelly Fish

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.

Upgrade Focal fossa to Jelly fish

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.

Restart WSL

 

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).

WSL Ubuntu 22.04 LTS Jammy Jelly FIsh

 

Comments (3)

  1. Eigil Krogh April 22, 2022
  2. Stefan April 28, 2022

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.