- How to Upgrade WSL 2 or 1 Ubuntu 20.04 to 22.04 LTS
- Upgrade Ubuntu 20.04 LTS to Ubuntu 22.04 LTS (Jammy Jelly Fish)
- System Update
- Install update-manager-core
- Upgrade Ubuntu 20.04 (Focal Fossa) to Ubuntu 22.04 (JellyFish)
- Check Ubuntu 22.04 WSL version
- 8 thoughts on “How to Upgrade WSL 2 or 1 Ubuntu 20.04 to 22.04 LTS”
- Release Notes for Windows Subsystem for Linux kernel
- 5.15.57.1
- 5.10.102.1
- 5.10.93.2
- 5.10.81.1
- 5.10.74.3
- 5.10.60.1
- 5.10.43.3
- 5.10.16.3
- 5.4.91
- 5.4.72
- 5.4.51-microsoft-standard
- 4.19.128-microsoft-standard
- 4.19.121-microsoft-standard
- 4.19.104-microsoft-standard
- 4.19.84-microsoft-standard
- Feedback
- Upgrade Ubuntu in WSL2 from 20.04 to 22.04
- 4 Answers 4
- Delete and reinstall
- «Normal» 22.04 upgrade from 20.04
- After upgrading (for either method)
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 a 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.
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 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.
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.
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 ? Reply
[This][1] [1]: https://gitlab.gnome.org/GNOME/Initiatives/-/wikis/Dark-Style-Preference
seems to work in my installation. Command line I use: gsettings set org.gnome.desktop.interface color-scheme prefer-dark Reply
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. Reply
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. Reply
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. Reply
Release Notes for Windows Subsystem for Linux kernel
We’ve added support for WSL 2 distributions, which use a full Linux kernel. This Linux kernel is open source, with its source code available at the WSL2-Linux-Kernel repository. This Linux kernel is delivered to your machine via Microsoft Update, and follows a separate release schedule to the Windows Subsystem for Linux which is delivered as part of the Windows image.
5.15.57.1
Release Date: Prerelease 2022/08/02
- Initial release of the WSL2 kernel based on the v5.15 kernel series
- Release rolling-lts/wsl/5.15.57.1
- Update to stable kernel version v5.15.57
- Enable Retbleed mitigations in x86_64 builds
- Enable nftables and traffic control
- Enable VGEM driver
- Fix 9p filesystem regressions since the last v5.10 WSL2 kernel
- Enable support for the Precision Time Protocol (PTP) clock device
- Enable the Landlock Linux Security Module (LSM)
- https://landlock.io/
- https://www.kernel.org/doc/html/v5.15/admin-guide/cgroup-v2.html#misc
5.10.102.1
Release Date: Prerelease 2022/05/09
- Release rolling-lts/wsl/5.10.102.1
- Update to upstream stable kernel release 5.10.102
- Disable unprivileged BPF by default
- It can be re-enabled by setting the kernel.unprivileged_bpf_disabled sysctl to 0
- Update Dxgkrnl Version to 2216
- Fix out of bounds array access for ioctls[]
- Implement wait for sync VM bus messages as “killable” to allow killing a process waiting for a synchronous call to the host
- Flush device for termination when process is destroyed to avoid a deadlock when the guest process is killed
5.10.93.2
Release Date: Prerelease 2022/02/08
- Release rolling-lts/wsl/5.10.93.2
- Update to upstream stable kernel release 5.10.93
- Enable CH341 and CP210X USB Serial drivers
- Fix README.md build instructions to include dwarves dependency for pahole
- Switched Dxgkrnl Version to 2111
- Removed the limit of existing and total sysmem allocations
- Properly flush the device for termination during process cleanup
- Fixed SPDX-License-Identifier for d3dkmthk.h
5.10.81.1
Release Date: Prerelease 2022/02/01
- Release rolling-lts/wsl/5.10.81.1
- Update to upstream stable kernel release 5.10.81
- Unify the kernel configurations by enabling missing options on arm64
- Enable non-arch specific ACPI options
- Enable options related to device-mapper RAID
- Enable Btrfs
- Enable LZO and ZSTD compression
5.10.74.3
Release Date: Prerelease 2021/11/10
- Release rolling-lts/wsl/5.10.74.3
- Update to upstream stable kernel release 5.10.74
- Enable BPF Type Format (CONFIG_DEBUG_INFO_BTF) for use by eBPF tools (microsoft/WSL#7437)
- Updated Dxgkrnl version to 2110
- Enable the Buffer Sharing and Sync File Frameworks (CONFIG_DMA_SHARED_BUFFER, CONFIG_SYNC_FILE) for Dxgkrnl usage
- Fix Dxgkrnl build failure with GCC versions older than 8.1 (microsoft/WSL#7558)
5.10.60.1
Release Date: 2021/11/02 ( Prerelease 2021/10/05 )
- Release rolling-lts/wsl/5.10.60.1
- Update to upstream stable kernel release 5.10.60
- Enable virtio-pmem with support for PCI BAR-relative addresses
- Enable vPCI support under Hyper-V for arm64
- Enable io_uring support
- Enable USB over IP support
- Enable paravirtualized spinlock support for x86_64
- Refresh dxgkrnl driver to pick up bug fixes and code cleanups
- Enable NFS client support for NFSv4.1
- Enable USB kernel configuration options for interacting with an Arduino over USB
- Provide a WSL2-specific README.md
5.10.43.3
Release Date: Prerelease 2021/07/12
- Version rolling-lts/wsl/5.10.43.3
- Update to upstream stable kernel release 5.10.43
- Improved dxgkrnl driver
- New revision of arm64 Linux on Hyper-V series (v9)
- Always use the Hyper-V hypercall interface on arm64 guests to support running on all versions of Windows
5.10.16.3
Release Date: 2021/07/20 ( Prerelease 2021/04/16 )
5.4.91
Release Date: Prerelease 2021/02/22
5.4.72
5.4.51-microsoft-standard
Release Date: Prerelease — 2020/10/22
4.19.128-microsoft-standard
4.19.121-microsoft-standard
4.19.104-microsoft-standard
4.19.84-microsoft-standard
Feedback
Submit and view feedback for
Upgrade Ubuntu in WSL2 from 20.04 to 22.04
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?
4 Answers 4
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
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.
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
ubuntu2004.exe install --ui=none
«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
wsl -l -v # Confirm the distribution name and adjust below if needed wsl --terminate Ubuntu
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:
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.