Upgrading from Debian 12 (Bookworm) to Debian 13 (Trixie) is generally straightforward if you follow the correct order of steps. This guide will take you safely through the entire process.
Before upgrading: create a backup
Important: Create a complete backup of all relevant data before you begin. On servers, a full system snapshot is recommended.
# Save list of installed packages
dpkg --get-selections > ~/packages-backup.txt
# Save current sources
cp /etc/apt/sources.list ~/sources.list.backup
Step 1: Fully update the current system
Ensure Debian 12 is fully up to date:
sudo apt update && sudo apt upgrade -y
sudo apt --purge autoremove
sudo apt full-upgrade -y
sudo apt --purge autoremove
Step 2: Switch package sources to Trixie
Update the package sources from Bookworm to Trixie:
sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
If you have additional sources in /etc/apt/sources.list.d/:
sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/*.list
Verify the sources:
cat /etc/apt/sources.list
The file should now contain trixie instead of bookworm.
Step 3: Update package lists
sudo apt update
You may see notices about changed packages – this is normal.
Step 4: Perform the upgrade
sudo apt full-upgrade -y
This process takes 10–30 minutes depending on your system and internet connection. If conflicts arise, you will be asked for a decision – when in doubt, keep the package maintainer's version.
Step 5: Clean up the system
sudo apt --purge autoremove
sudo apt autoclean
Step 6: Reboot
sudo reboot
Verify after reboot
cat /etc/debian_version
lsb_release -a
uname -r
Common issues
Third-party repository errors: If external sources (e.g. for MariaDB, Docker) cause problems, temporarily disable them, perform the upgrade, then reconfigure.
Services not starting: Configuration files may have changed after the upgrade. Check logs with:
journalctl -xe
systemctl status SERVICE_NAME
Conclusion
The Debian upgrade is generally problem-free if you proceed systematically and create a backup beforehand. For production servers, testing on a staging system first is strongly recommended.
Need help upgrading your Linux servers? As an experienced Linux administrator, I am happy to assist. Get in touch.