This a relatively easy upgrade, so it’s worth doing in situ if you’ve customized your distro. If you haven’t done anything you’d like to keep from your current installation, you can always download a fresh copy from the Microsoft Store.
First order of business is to open PowerShell and backup your current installation. Switch to the directory you’d like to hold your backup and execute:
wsl --export Debian debian10.tar
Next, launch your Debian terminal and do the usual update and upgrade:
sudo apt-get update && sudo apt-get upgrade
And then we’ll update the repositories by editing /etc/apt/sources.list. Modify the entries so they look like this. Mostly you’ll just be changing buster to bullseye, but there are other differences too. Edit carefully:
deb http://deb.debian.org/debian bullseye main
deb http://deb.debian.org/debian bullseye-updates main
deb http://security.debian.org/debian-security bullseye-security main
deb http://ftp.debian.org/debian bullseye-backports main
Another round of:
sudo apt-get update && sudo apt-get upgrade
Many packages will update, some will be held back. No worries, we’ll pick up the rest in a moment. Respond “Yes” if you’re asked about restarting services.
The last step is to do a “full-upgrade” which should pickup any packages that weren’t done before now, and also advance the version number from 10 to 11.
sudo apt full-upgrade
And that’s about it — enjoy Debian 11 “Bullseye”!
What does this command do in practice?
wsl –export Debian debian10.tar
This command creates a backup of your current WSL2 Debian 10 installation — in case you want to restore that version for some reason.