Pre-Upgrade System Preparation
elevate to root
Create System Backup
mkdir mkdir /mnt/athena_backups/"$HOSTNAME"_backups
tar -czf /mnt/athena_backups/"$HOSTNAME"_backups/etc-backup-$(date +%Y%m%d).tar.gz /etc
dpkg --get-selections > /mnt/athena_backups/"$HOSTNAME"_backups/package-selections-$(date +%Y%m%d).txt
Ensure Debian 12 is fully updated before proceeding
apt update
apt upgrade -y
apt dist-upgrade -y
apt clean
apt autoremove -y
Verify system integrity before upgrade
apt --fix-broken install
dpkg --configure -a
Create safety copy of repository settings
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
Update Main Sources List and Additional Repositories
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' {} ;
This systematically updates all repository references from Bookworm to Trixie across all configuration files.
apt update
Third-party repositories may not immediately support Trixie. Consider temporarily disabling them by adding ‘#’ at the beginning of their lines in sources configuration files.
Minimal Upgrade First
apt upgrade --without-new-pkgs
Full Distribution Upgrade
apt full-upgrade
Confirm successful upgrade completion
cat /etc/debian_version
lsb_release -a
cat /etc/os-release
Clean Obsolete Packages
apt autoremove -y
apt autoclean
Update Package Cache
apt update
apt list --upgradable
System Reboot: Complete the upgrade process
systemctl reboot