How To Upgrade Debian 11 to Debian 12
Debian 11 (Bullseye) reached its End of Life (EOL) on August 31, 2026. Debian no longer provides security updates for Debian 11 after this date.
If your VPS is running Debian 11, it is recommended to upgrade to Debian 12 (Bookworm) to continue receiving security updates and maintenance support.
This guide explains how to upgrade an existing Debian 11 installation to Debian 12.
Prerequisites
- A VPS running Debian 11 (Bullseye)
- Root or sudo access
- A stable Internet connection
- Sufficient free disk space
- A recent backup or snapshot of the VPS
Verify the Current Debian Version
Verify that your server is currently running Debian 11:
cat /etc/debian_version
Output:
11.11
You can also use:
cat /etc/os-release
Output:
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Create a Backup
Before starting the upgrade, it is strongly recommended to create a backup of your server.
The upgrade process modifies system packages, repositories, and configuration files. A backup allows you to restore the server if an unexpected issue occurs during the upgrade.
If you are using a CrownCloud VPS, you can create a Snapshot from the CrownPanel before starting the upgrade.
For instructions, refer to our guide:
How to Manage Snapshots in CrownPanel
https://wiki.crowncloud.net/?How_to_Manage_Snapshots_in_CrownPanel
Once you have confirmed that the backup or snapshot has been created successfully, continue with the upgrade.
Update Existing Packages
Before changing the Debian repositories, make sure the existing Debian 11 system is fully updated.
apt update
apt upgrade -y
apt full-upgrade -y
Remove packages that are no longer required:
apt autoremove -y
If a reboot is required, reboot the server before continuing:
reboot
After the server comes back online, reconnect using SSH.
Check APT Sources
Before upgrading, check the configured APT repositories:
grep -Rhv '^#' /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null
The Debian repositories should currently reference:
bullseye
Third-party repositories may not support Debian 12. It is recommended to disable or remove third-party repositories before starting the upgrade.
Update APT Sources to Debian 12
Replace the Debian 11 repository references with Debian 12.
Edit the main sources file:
nano /etc/apt/sources.list
Replace:
bullseye
with:
bookworm
For example:
deb http://deb.debian.org/debian bookworm main
deb http://deb.debian.org/debian bookworm-updates main
deb http://security.debian.org/debian-security bookworm-security main
If you use additional components such as contrib, non-free, or non-free-firmware, keep them in the repository configuration as required.
Check the files under:
ls /etc/apt/sources.list.d/
and make sure they do not contain repositories pointing to unsupported or incompatible releases.
Update the Package Lists
After updating the repositories, refresh the package lists:
apt update
Review the output carefully and make sure there are no repository or dependency errors.
Perform the Minimal Upgrade
Debian recommends performing a minimal upgrade before the complete system upgrade. This helps reduce the possibility of dependency conflicts during the main upgrade.
Run:
apt upgrade --without-new-pkgs
Review any prompts carefully and allow the process to complete.
Upgrade to Debian 12
Once the minimal upgrade has completed successfully, perform the full system upgrade:
apt full-upgrade
This will upgrade the installed packages to their Debian 12 versions and may install new packages or remove obsolete packages required to complete the upgrade.
During the upgrade, you may be prompted about modified configuration files.
Review these prompts carefully before selecting an option.
Reboot the Server
Once the upgrade has completed successfully, reboot the server:
reboot
The server may take longer than usual to boot while the new kernel and upgraded services are initialized.
Verify the Upgrade
After reconnecting to the server, verify the installed Debian version:
cat /etc/debian_version
Outut:
12.15
You can also run:
cat /etc/os-release
Output:
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
VERSION_ID="12"
VERSION_CODENAME=bookwormPRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
You can also verify the running kernel:
uname -r
Output:
6.1.0-52-amd64
Check for Remaining Package Issues
Check whether any packages are broken or have unresolved dependencies:
dpkg --audit
Then run:
apt --fix-broken install
If no issues are present, the command should complete without requiring changes.
You can also check for packages that are no longer required:
apt autoremove
Review the packages listed before confirming their removal.
Clean Up the System
Remove downloaded package files that are no longer required:
apt autoclean
You can also remove obsolete packages:
apt autoremove --purge -y
Verify Important Services
After the upgrade, verify that the services running on your VPS are working as expected.
For example:
systemctl --failed
If no failed services are reported, you can verify individual services as required.
For example:
systemctl status nginx
or:
systemctl status apache2
Check your applications, websites, databases, mail services, and other workloads to confirm they are operating normally after the upgrade.
Conclusion
You have successfully upgraded your VPS from Debian 11 (Bullseye) to Debian 12 (Bookworm).
Make sure to verify your applications and services after the upgrade and keep the VPS updated with the latest Debian security and package updates.
apt update
apt upgrade -y CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS