How to Upgrade Debian 12 Bookworm to Debian 13 Trixie

Estimated reading: 3 minutes 1271 views

Introduction

Debian 13 (Trixie) is the next major release of Debian, delivering enhanced performance, security updates, and broader software support. Upgrading from Debian 12 (Bookworm) ensures your system remains secure, stable, and compatible with the latest packages. Before proceeding, careful preparation is essential to minimize risks during the upgrade process.

I. Pre-Upgrade Preparation

1. Backup System Data

Before upgrading, make sure to back up all important data and configuration files to prevent data loss in case of unexpected issues during the upgrade.


2. Update the Current System

Ensure your Debian 12 installation is fully up to date:

apt update 
apt upgrade 
apt dist-upgrade

These commands apply the latest security patches and updates before switching to the new release.


3. Clean Up Unused Packages and Cache

apt clean 
apt autoremove

Removes unnecessary packages and clears cached files to free disk space for the upgrade process.


4. Check System Integrity

apt --fix-broken install 
dpkg --configure -a

Resolves any existing package issues to prevent upgrade conflicts.


Disk Space Warning

Ensure at least 5 GB of free space on the root partition before starting:

df -h /

II. Update Repository Configuration

1. Backup Current Repository Configuration

cp /etc/apt/sources.list /etc/apt/sources.list.bookworm-backup 
cp -r /etc/apt/sources.list.d /etc/apt/sources.list.d.bookworm-backup

Keep a copy of your current repository configuration in case you need to revert.


2. Update Repository Codename from Bookworm to Trixie

sed -i 's/bookworm/trixie/g' /etc/apt/sources.list 
find /etc/apt/sources.list.d -name "*.list" -exec sed -i 's/bookworm/trixie/g' {} \;

Automatically replaces all repository entries to point to Debian 13 (Trixie).
Note: Review all .list files manually to ensure the repositories are valid.


3. Refresh Package Database

apt update

Downloads the latest package lists from the updated repositories.


Third-Party Repositories

Third-party repositories (e.g., Docker, NodeSource, etc.) may not yet support Trixie.
Temporarily disable them by commenting out their lines with # in the source list files.


III. Debian 13 Upgrade Process

1. Perform a Minimal Upgrade First

apt upgrade --without-new-pkgs

Updates existing packages without installing new dependencies, reducing the risk of upgrade conflicts.


2. Perform a Full System Upgrade

apt full-upgrade

Handles all dependency changes, installs new packages, and removes obsolete ones.
When prompted about service restarts or configuration file replacements, it is generally safe to keep existing configurations unless you have specific reasons to replace them.

Estimated duration: 20–60 minutes depending on system performance and network speed.


IV. Post-Upgrade Verification

1. Verify System Version

cat /etc/debian_version 
lsb_release -a 
cat /etc/os-release

The output should display Debian 13.x and codename Trixie, confirming a successful upgrade.


2. Remove Obsolete Packages

apt autoremove 
apt autoclean

Cleans up old and unnecessary dependencies.


3. Refresh Package Information

apt update 
apt list --upgradable

Ensures your package database is up to date and shows any remaining updates.


4. Reboot the System

systemctl reboot

Reboots the system to load the new kernel and updated services.


Conclusion

Congratulations! Your system has been successfully upgraded from Debian 12 (Bookworm) to Debian 13 (Trixie).
After rebooting, your system will be running with improved stability, security, and performance.

To keep your system up to date, regularly run:

apt update && apt upgrade

This ensures continued access to the latest patches and package improvements.

Share this Doc

How to Upgrade Debian 12 Bookworm to Debian 13 Trixie

Or copy link

CONTENTS