How To Upgrade Debian 12 to Debian 13



Before getting started, we suggest you Learn Linux Basics and follow these precautions.

Updated: 2025-08-09
Created: 2025-08-09

This guide outlines how to upgrade from Debian 12 (Bookworm) to Debian 13 (Trixie), the current stable release as of August 9, 2025.

The following steps can be performed on a standard desktop or server as an in-place upgrade on a live system, either from a local terminal or over a remote SSH connection.

Before you begin, create a full system backup or snapshot, ensure at least 2-3 GB of free space is available, and review the Debian 13 release notes for any special considerations relevant to your system, as the steps provided here are general guidelines.

Step 1

Update and clean the current system.

apt update

apt upgrade

apt autoremove

apt clean

Step 2

Switch the Debian repositories from Bookworm to Trixie by updating the sources file. You can do this either by using the sed command to automatically replace all instances, or by editing the file manually, whichever you prefer.

Search and replace with sed.

sed -i 's/bookworm/trixie/g' /etc/apt/sources.list

Or, edit your source list manually.

vi /etc/apt/sources.list

Replace all occurrences of the codename bookworm with trixie.

Current sources.list should look similar to this:

deb http://deb.debian.org/debian/ bookworm main
deb-src http://deb.debian.org/debian/ bookworm main
deb http://security.debian.org/debian-security bookworm-security main
deb-src http://security.debian.org/debian-security bookworm-security main
deb http://deb.debian.org/debian/ bookworm-updates main
deb-src http://deb.debian.org/debian/ bookworm-updates main

Modified sources.list will look like this once you're done:

deb http://deb.debian.org/debian/ trixie main
deb-src http://deb.debian.org/debian/ trixie main
deb http://security.debian.org/debian-security trixie-security main
deb-src http://security.debian.org/debian-security trixie-security main
deb http://deb.debian.org/debian/ trixie-updates main
deb-src http://deb.debian.org/debian/ trixie-updates main

 

If you have added third-party repositories, these will also need to be updated. This may not apply to your system, but before proceeding, check for repository .list files under the /etc/apt/sources.list.d/ directory. If found, you should update these sources as well. Consult the software distributor for guidance, since software from outside the official Debian repositories may not be supported. If no trixie branch exists yet, disable or remove that repo temporarily until support is available.

Step 3

Update the package index.

apt update

Step 4

Upgrade the minimal base system. To minimize the risk of breaking the system during the early stages of a major version upgrade, it is recommended to use the --without-new-pkgs option. This ensures all current packages are updated without introducing new ones, thereby reducing the likelihood of dependency issues.

apt upgrade --without-new-pkgs

Step 5

Next, execute the full-upgrade, this will handle dependency changes, install new packages, and remove obsolete ones, completing the transition to the new release.

apt full-upgrade

Step 6

Reboot the system.

reboot

Step 7

Verify your release has been upgraded.

lsb_release -a

Output will be similar to this.

No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 13 (trixie)
Release:	13
Codename:	trixie

Step 8

Clear out the local repository of retrieved package files and dependencies that are no longer required.

apt clean

apt autoremove

Step 9

APT is deprecating the old sources.list format in favour of the newer deb822 (.sources) format for improved management and security. Next, we will automatically convert the repository format, including third-party repositories, by running this command and confirming with [Y]es when prompted.

apt modernize-sources

Output will be similar to this.

The following files need modernizing:
  - /etc/apt/sources.list

Modernizing will replace .list files with the new .sources format,
add Signed-By values where they can be determined automatically,
and save the old files into .list.bak files.

This command supports the 'signed-by' and 'trusted' options. If you
have specified other options inside [] brackets, please transfer them
manually to the output files; see sources.list(5) for a mapping.

For a simulation, respond N in the following prompt.
Rewrite 1 sources? [Y/n]

Modernizing /etc/apt/sources.list...
- Writing /etc/apt/sources.list.d/debian.sources

 

After completing these steps, your Debian system should be fully upgraded and ready to use.