Upgrade Ubuntu on WSL¶
This page describes how to upgrade an installation of an LTS release of Ubuntu to a new version.
Important
Upgrades of Ubuntu instances require WSL 2 with systemd enabled.
Read about the differences between WSL 1 and WSL 2.
For a list of the available Ubuntu LTS releases, run wsl --list --online.
Upgrading to an LTS release¶
To upgrade an instance of Ubuntu on WSL, run:
$ sudo apt update && sudo apt full-upgrade -y
$ sudo do-release-upgrade
When new LTS versions are released, the Ubuntu instance can be upgraded once the first point release is available.
This upgrade behaviour is determined by the Prompt setting in
release-upgrades, which is set to lts by default:
Prompt=lts
Renaming your instance after an upgrade
If you install a numbered version of Ubuntu, such as Ubuntu-22.04, then
upgrade it to the next LTS (24.04), you may wish to rename your instance to
reflect that new version.
Our guide on instance management and configuration provides instructions on renaming instances.
Upgrading to an interim release¶
If you want do-release-upgrade to upgrade an instance to any new Ubuntu
release, including interim releases, change the Prompt setting as follows:
-Prompt=lts
+Prompt=normal
See also
A detailed reference on the Ubuntu releases available to install for WSL.