Original posting
https://gist.github.com/bramtechs/50d724a33d37278d7ca003c6119c8fea
Just copying contenst for backup.
- Install and open Debian on WSL (if not already)
wsl --install -d debian
wsl -d debian
- Go into root
sudo -s
- Upgrade Debian 9 to 10
apt update -y && \
apt upgrade -y && \
echo "deb http://deb.debian.org/debian/ buster main
deb http://deb.debian.org/debian/ buster-updates main
deb http://security.debian.org/debian-security buster/updates main" > /etc/apt/sources.list && \
apt update -y && \
apt upgrade -y && \
apt dist-upgrade -y
- Upgrade Debian 10 to 11
echo "deb http://deb.debian.org/debian/ bullseye main
deb http://deb.debian.org/debian/ bullseye-updates main" > /etc/apt/sources.list && \
apt update -y && \
apt upgrade -y && \
apt dist-upgrade -y
- Debian 11 to 12
echo "deb http://deb.debian.org/debian/ bookworm main
deb http://deb.debian.org/debian/ bookworm-updates main" > /etc/apt/sources.list && \
apt update -y && \
apt upgrade -y && \
apt dist-upgrade -y && \
apt autoremove -y && \
exit