Skip to content

Instantly share code, notes, and snippets.

@bramtechs
Last active May 29, 2025 19:14
Show Gist options
  • Save bramtechs/50d724a33d37278d7ca003c6119c8fea to your computer and use it in GitHub Desktop.
Save bramtechs/50d724a33d37278d7ca003c6119c8fea to your computer and use it in GitHub Desktop.
Add Debian 12 to 13 contribution

Upgrade Debian 9 (current WSL) to Debian 12 (bookworm testing)

Note: I do not maintain this gist anymore, but people report that it still works. Please check the comments for any revisions or extra things you should take into consideration.

As of writing, the Debian distro for WSL (Windows Subsystem for Linux) is quite old.

You can get more up-to-date package managers, text-editors and compilers by upgrading WSL to Debian 12 (current testing).

  • Root required
  • Use at your own risk, preferably on a fresh installation.
  • Choose 'yes' when Debian requests to restart services.
  1. Install and open Debian on WSL (if not already)
wsl --install -d debian
wsl -d debian
  1. Go into root
sudo -s
  1. 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
  1. 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
  1. 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
  1. Debian 12 to 13 (provided by MarkusGnigler)
echo "deb http://deb.debian.org/debian/ trixie main
deb http://deb.debian.org/debian/ trixie-updates main" > /etc/apt/sources.list && \
apt update -y && \
apt upgrade -y && \
apt dist-upgrade -y && \
apt autoremove -y && \
exit
@ravensorrow
Copy link

Debian 12 to 13:

echo "deb http://deb.debian.org/debian/ trixie main
deb http://deb.debian.org/debian/ trixie-updates main" > /etc/apt/sources.list && \
apt update -y && \
apt upgrade -y && \
apt dist-upgrade -y && \
apt autoremove -y && \
exit

This fails when it gets to processing triggers for systems and comes to a crashing halt.

nvm, I fixed it. Rebooted WSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment