How to Upgrade WSL 2 or 1 Ubuntu 20.04 to 22.04 LTS
To Nha Notes | May 21, 2022, 11:03 p.m.
System update
sudo apt update
sudo apt upgrade
sudo apt --purge autoremove
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 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
Upgrade to Ubuntu 22.04 (Jelly Fish)
sudo do-release-upgrade -d
Check Ubuntu 22.04 WSL version
lsb_release -a
cat /etc/os-release
References
https://www.how2shout.com/linux/how-to-upgrade-wsl-2-or-1-ubuntu-20-04-to-22-04-lts/