← Back to Debian guides

How to upgrade from Debian 11 to Debian 12

Hello everyone! In this guide, I'll show you how to upgrade from Debian 11 to Debian 12.

!!! WARNING !!! THIS WILL BREAK YOUR CLOUD-INIT - PROCEED WITH CAUTION

1. Updating sources.list from Debian 11 to Debian 12

Run updates first:

apt update && apt upgrade -y

Open the sources.list:

nano /etc/apt/sources.list

Replace every "bullseye" with "bookworm":

deb http://deb.debian.org/debian bullseye main
deb-src http://deb.debian.org/debian bullseye main

deb http://security.debian.org/debian-security bullseye-security main
deb-src http://security.debian.org/debian-security bullseye-security main

This is how the config should look like after adjusting it correctly:

deb http://deb.debian.org/debian bookworm main
deb-src http://deb.debian.org/debian bookworm main

deb http://security.debian.org/debian-security bookworm-security main
deb-src http://security.debian.org/debian-security bookworm-security main

2. Downloading new packages

Apply updates:

apt update && apt upgrade -y --without-new-pkgs

Upgrade fully:

apt update && apt full-upgrade -y

Reboot system:

reboot now

After reboot, Debian 12 should be installed successfully.