Previously, I have upgraded from Debian 11.11 to Debian 12.12. On this post I will be upgrading from Debian 12.12 to Debian 13.3.
Pre-upgrade Process
Confirm the installed Debian version just to make sure where we are starting from:
cat /etc/debian_version
Which returns:
12.12
Gather System Information
This command gives us more information about the current version installed on our device:
lsb_release -a
Which returns:
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
This is another alternative to get even more information about the installed system version:
cat /etc/os-release
Which returns:
PRETTY_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/"
Storage Analysis
Before upgrading, I wanted to know how much storage space I have used since Debian 11 was installed on my T440p.
Analyze APT Cache
First, I moved to the directory where apt stores the packages before they are installed on the system:
cd /var/cache/apt
Once there, I ran this command to measure the total storage space used:
sudo du -sh .
Which returned the following:
31G /var/cache/apt/
Meaning that in 4 years, I have downloaded 31 GB either as new packages or updates for existing packages.
Package Inventory
Something important to me before upgrading is to make a list of all the packages currently installed.
Methods to List Packages
Selection List: Saves a basic list to packagesInstalled.
dpkg --get-selections > packagesInstalled
Detailed Query: Includes status, version, and architecture.
dpkg-query -l > dpkgQuery-l
Binary Names Only: Useful for clean, one-per-line lists.
dpkg-query -f '${binary:Package}\n' -W > dpkgQuery-f_binPac
Manual Selections: Lists packages specifically requested by the user.
apt-mark showmanual > manuallyInstalled
The Upgrade Process
OK... enough nostalgia for the moment; this is where the fun begins!
Update Current System
As it is, I need to make sure that my system is fully up to date:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
Modify Package Sources
First, make a backup of your current configuration:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.orig
Then, update the file to switch the codename to Trixie:
cd /etc/apt/
sudo sed -i.bak '/^deb-src\|^deb/ s/bookworm/trixie/g' /etc/apt/sources.list
Perform the Full Upgrade
Update the repository data:
sudo apt update
Check for upgradable packages:
sudo apt list --upgradable
We will upgrade first without installing new packages:
sudo apt upgrade --without-new-pkgs
Once this is completed, we can fully upgrade our system:
sudo apt full-upgrade
Conclusion
Once this process was completed, I was able to reboot my system and run Debian 13.3 on my Lenovo ThinkPad T440p without having to reinstall from scratch.