A comprehensive, battle-tested guide for upgrading Debian 12 (Bookworm) to Debian 13 (Trixie) with minimal downtime and maximum safety.
This guide has been crafted through real-world experience and community feedback. It includes not just the upgrade steps, but also troubleshooting tips, automation options, and edge cases you might encounter. Star this repo if it helps you! β
π΄ CRITICAL: Always create a backup before proceeding! Even though Debian upgrades are generally reliable, hardware failures, power outages, or unexpected issues can occur. Don't be the person who skips backups and regrets it later.
- System running Debian 12 (Bookworm)
- Root or sudo access
- Stable internet connection
- At least 10GB free space in root partition (recommended)
- Time for the upgrade process (30-90 minutes depending on system)
Choose one of these backup methods:
# Replace /dev/sdX with your actual disk device
sudo dd if=/dev/sdX of=/path/to/backup/disk-backup-$(date +%Y%m%d).img bs=4M status=progress- Download Clonezilla Live ISO
- Boot from USB/CD
- Follow the GUI to create a full system image
# Backup to external drive
sudo rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/Ensure you have sufficient space for the upgrade:
# Check root partition space
df -h /
# As a rule of thumb, ensure at least 10GB free space
# You can get by with less, but 10GB provides a comfortable bufferIf space is insufficient:
# Clean package cache
sudo apt clean
# Remove old kernels (keep current + 1 previous)
sudo apt autoremove --purgeBefore upgrading to Debian 13, ensure your Debian 12 system is fully up-to-date:
# Update package lists and upgrade all packages
sudo apt update && sudo apt full-upgrade
# Clean package cache to free up space
sudo apt clean
# Remove unnecessary packages
sudo apt autoremoveReboot if kernel updates were installed:
sudo rebootAlways backup your current sources configuration:
# Backup the main sources file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# Also backup sources.list.d directory if it exists
if [ -d "/etc/apt/sources.list.d" ]; then
sudo cp -r /etc/apt/sources.list.d /etc/apt/sources.list.d.bak
fiFirst, determine which configuration method your system uses:
# Check if using traditional sources.list
if [ -s "/etc/apt/sources.list" ] && grep -q "bookworm" /etc/apt/sources.list; then
echo "Using traditional sources.list format"
SOURCES_METHOD="traditional"
elif find /etc/apt/sources.list.d -name "*.list" 2>/dev/null | xargs grep -l "bookworm" | head -1; then
echo "Using sources.list.d directory format"
SOURCES_METHOD="directory"
else
echo "Please check your sources configuration manually"
fi# Option 1: Using sed (automated)
sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
# Option 2: Using apt edit-sources (interactive)
sudo apt edit-sources
# Option 3: Manual editing with vim/nano
sudo vim /etc/apt/sources.list
# Replace all instances of 'bookworm' with 'trixie'# Update all .list files in sources.list.d
find /etc/apt/sources.list.d -name "*.list" -exec sudo sed -i 's/bookworm/trixie/g' {} \;# Check that bookworm has been replaced with trixie
grep -r "bookworm\|trixie" /etc/apt/sources.list /etc/apt/sources.list.d/sudo apt update# See what packages will be upgraded
apt list --upgradeable
# Count total packages to be upgraded
apt list --upgradeable | wc -l# Upgrade without installing new packages
sudo apt upgrade --without-new-pkgs# Always simulate first to catch potential issues
sudo apt full-upgrade -sReview the simulation output carefully! Look for:
- Packages being removed unexpectedly
- Conflicts or dependency issues
- Services that might need restart
If the simulation looks good, proceed:
sudo apt full-upgradeNote: This process may take 30-90 minutes depending on your system and internet connection. Also you usually want to "baby-sit" the process to identify possible errors and read carefully the news / changelogs to stay up-to-date with the new changes in debian 13. Do not skip reading the news for critical systems.
Check your new Debian version:
# Should output "13" or "trixie/sid"
cat /etc/debian_version
# Alternative verification
lsb_release -aDebian 13 introduces the new DEB822 sources format. Modernize your sources:
# Convert to modern sources format
sudo apt modernize-sourcesThis command will:
- Convert traditional sources.list to the new format
- Place new sources in
/etc/apt/sources.list.d/ - Backup old configuration automatically
For managing multiple machines, use Ansible playbook.
Symptoms: After upgrade, Qt applications may display with different themes than GTK applications, especially noticeable in minimal installations and custom, not default themes.
Solution:
# Install Qt5 Kvantum theme engine
sudo apt install qt5-style-kvantum
# Create Kvantum config directory
mkdir -p ~/.config/Kvantum
# Copy your current theme to Kvantum
# Replace 'myFooBarTheme' with your actual theme name
cp -r ~/.themes/myFooBarTheme/Kvantum/* ~/.config/Kvantum/
# Or from system themes:
# cp -r /usr/share/themes/myFooBarTheme/Kvantum/* ~/.config/Kvantum/
# Configure Kvantum theme
kvantummanager
# Set environment variables for consistent theming
echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ~/.profile
echo "QT_STYLE_OVERRIDE=kvantum" >> ~/.profile
# Or set system-wide in /etc/environment:
echo -e "QT_QPA_PLATFORMTHEME=qt5ct\nQT_STYLE_OVERRIDE=kvantum" | sudo tee -a /etc/environmentNote: This is primarily needed for minimal desktop installations and shouldn't affect headless servers.
Symptoms: Ctrl+Alt+Up/Down shortcuts for workspace navigation stop working in XFCE.
Quick Fix Script:
#!/bin/bash
# Save as ~/fix-xfce-workspaces.sh
echo "Applying XFCE workspace navigation hotfix..."
# Find the correct plugin number for workspace pager
PLUGIN_NUM=$(xfconf-query -c xfce4-panel -l | while read prop; do
if echo "$prop" | grep -q plugin; then
value=$(xfconf-query -c xfce4-panel -p "$prop" 2>/dev/null)
if echo "$value" | grep -qi "pager\|workspace"; then
echo "$prop" | sed 's/.*plugin-\([0-9]*\).*/\1/'
fi
fi
done | head -1)
if [ -n "$PLUGIN_NUM" ]; then
echo "Found workspace pager at plugin-$PLUGIN_NUM"
# Toggle miniature view to reset the plugin
xfconf-query -c xfce4-panel -p "/plugins/plugin-$PLUGIN_NUM/miniature-view" -s true
sleep 1
xfconf-query -c xfce4-panel -p "/plugins/plugin-$PLUGIN_NUM/miniature-view" -s false
echo "Done! Try your Ctrl+Alt+Up/Down shortcuts now."
else
echo "Could not find workspace pager plugin. Please check manually."
fiMake it executable and run:
chmod +x ~/fix-xfce-workspaces.sh
~/fix-xfce-workspaces.shAuto-run on login:
Add to your ~/.profile:
# Add this line to ~/.profile
~/fix-xfce-workspaces.sh 2>/dev/nullAlternative via xfce autostart:
(replace user in Exec=/home/user/fix-xfce-workspaces.sh/fix-xfce-workspaces.sh with your actual username)
cat > ~/.config/autostart/fix-xfce-workspaces.desktop << EOF
[Desktop Entry]
Type=Application
Name=Fix XFCE Workspaces
Exec=/home/user/fix-xfce-workspaces.sh/fix-xfce-workspaces.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
EOFnow re-login
If something goes wrong during upgrade:
- Boot from Debian Live USB
- Mount your system partition
- Restore from backup or chroot to fix issues
# Fix broken packages
sudo apt --fix-broken install
# Reconfigure packages
sudo dpkg --configure -a
# Force package installation if needed (use carefully!)
sudo apt install -f# Restore original sources
sudo cp /etc/apt/sources.list.bak /etc/apt/sources.list
sudo apt updateExpected upgrade statistics:
- Packages upgraded: ~900-3000 (depending on installation)
- Download size: 800MB - 2GB
- Disk space required: 2-5GB during upgrade
- Time required: 30-90 minutes
- Reboot required: Usually yes (kernel updates)
Found an issue or have improvements? Please:
- β Star this repository
- π Open an issue
- π§ Submit a pull request
- π¬ Share your experience in discussions
This guide is released under the MIT License. Feel free to use, modify, and distribute.
β If this guide helped you successfully upgrade to Debian 13, please star this repository! Your stars help others discover this resource and motivate continued maintenance and improvements.
π Encountered issues? Please report them in the Issues section so we can help others avoid the same problems.
π Upgrade Checklist Summary
Quick reference for experienced administrators:
- β Backup system (dd, clonezilla, rsync)
- β Check disk space (minimum 10GB recommended)
- β Update current system (apt update && apt full-upgrade)
- β Clean packages (apt clean && apt autoremove)
- β Backup sources (cp /etc/apt/sources.list sources.list.bak)
- β Update repositories (bookworm β trixie)
- β Simulate upgrade (apt full-upgrade -s)
- β Perform upgrade (apt full-upgrade)
- β Verify version (cat /etc/debian_version)
- β Modernize sources (apt modernize-sources)
π Common Search Terms
This guide covers solutions for:
- "How to upgrade Debian 12 to Debian 13"
- "Debian Bookworm to Trixie upgrade steps"
- "Debian dist-upgrade tutorial"
- "Linux distribution upgrade guide"
- "Debian server upgrade procedure"
- "Debian package management upgrade"
- "System administration Debian upgrade"
π‘ Have improvements? Pull requests are welcome! Let's make this the best Debian upgrade guide available.
Last updated: August 2025 | Tested on: Debian 12.x β 13.x