> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Upgrade Debian 12 (Bookworm) to Debian 13 (Trixie)

> Upgrade Debian 12 to 13: update bookworm fully, change your APT sources to trixie, run apt upgrade --without-new-pkgs, then apt full-upgrade and reboot.

To upgrade Debian 12 to Debian 13, first install every bookworm update and reboot. Then change `bookworm` to `trixie` in your APT sources, run `sudo apt update`, a minimal upgrade with `sudo apt upgrade --without-new-pkgs`, and then `sudo apt full-upgrade`. Reboot and check with `cat /etc/debian_version`. Run it inside `tmux` or `screen` so a dropped SSH connection doesn't interrupt it.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Intermediate | 30 to 60 minutes | Debian 12 (bookworm) → Debian 13 (trixie), amd64 | sudo or root access, a backup, free disk space |

## Before you start

> [!WARNING]
>
> A release upgrade replaces most of your system's packages. Take a full [backup or snapshot](https://help.freakhosting.com/portals/vps-panel/how-to-schedule-and-restore-backups.md) and check you can restore it. On a dedicated server, copy important data off the server first. Have the [VNC console](https://help.freakhosting.com/portals/vps-panel/how-to-enable-and-use-vnc-console-access.md) ready in case SSH stops working.

* [Connect with SSH](https://help.freakhosting.com/portals/other/how-to-connect-to-a-linux-server-with-ssh.md) as a [sudo user](https://help.freakhosting.com/portals/other/how-to-create-a-sudo-user-on-linux.md) or root. Root can leave out `sudo`.
* Debian 13 "trixie" was released on 9 August 2025. You can only upgrade from Debian 12; skipping releases isn't supported. If you are on Debian 11 or older (end of life), upgrade to 12 first or reinstall.
* Read the official [Debian 13 release notes](https://www.debian.org/releases/trixie/release-notes/), especially "Issues to be aware of for trixie".
* Debian 13 no longer supports 32-bit PCs (i386) as a normal architecture. Check yours with `dpkg --print-architecture`; it should say `amd64` (or `arm64`).

## How to prepare Debian 12

**1. Start a tmux session**

```bash theme={null}
sudo apt install tmux
tmux new -s upgrade
```

If SSH drops, reconnect and run `tmux attach -t upgrade`. See [tmux and screen](https://help.freakhosting.com/portals/other/how-to-keep-ssh-sessions-running-with-tmux-and-screen.md).

**2. Install all bookworm updates**

```bash theme={null}
sudo apt update
sudo apt full-upgrade
sudo reboot
```

This also gets you the OpenSSH update Debian requires before upgrading over SSH (`1:9.2p1-2+deb12u7` or later).

**3. Check package health**

```bash theme={null}
sudo dpkg --audit
apt-mark showhold
```

Both should print nothing. Remove holds with `sudo apt-mark unhold <package>`.

**4. Find packages that aren't from Debian**

```bash theme={null}
apt list '?narrow(?installed, ?not(?origin(Debian)))'
```

Software from other repositories (Docker, PHP from sury.org, control panels) may need its own trixie repository. Check the vendor supports Debian 13.

**5. Back up APT and package state**

```bash theme={null}
sudo tar -czf /root/pre-trixie-etc.tar.gz /etc /var/lib/dpkg /var/lib/apt/extended_states
dpkg --get-selections '*' > ~/pre-trixie-packages.txt
```

**6. Check disk space**

```bash theme={null}
df -h / /boot
```

Debian recommends a `/boot` of at least 768 MB with about 300 MB free, and enough room on `/` for the downloaded packages.

## How to change the APT sources to trixie

**1. See where your sources are**

```bash theme={null}
ls /etc/apt/sources.list /etc/apt/sources.list.d/
```

**2. Write the new Debian sources**

Debian 13 recommends the deb822 format in `/etc/apt/sources.list.d/debian.sources`:

```bash theme={null}
sudo nano /etc/apt/sources.list.d/debian.sources
```

```text theme={null}
Types: deb
URIs: https://deb.debian.org/debian
Suites: trixie trixie-updates
Components: main non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: https://security.debian.org/debian-security
Suites: trixie-security
Components: main non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
```

Add `contrib non-free` to `Components` if you used them before.

**3. Remove the old bookworm lines**

Comment out or delete every `bookworm` entry in `/etc/apt/sources.list` and other files in `/etc/apt/sources.list.d/`, including `bookworm-backports`. To keep your existing one-line format instead, you can replace the release name everywhere:

```bash theme={null}
sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
```

Check that no source lists both releases: `grep -r bookworm /etc/apt/` should print nothing.

## How to run the upgrade

**1. Refresh the package lists**

```bash theme={null}
sudo apt update
```

**2. Minimal upgrade**

```bash theme={null}
sudo apt upgrade --without-new-pkgs
```

This upgrades what it can without installing or removing packages, which makes the main step smoother.

**3. Full upgrade**

```bash theme={null}
sudo apt full-upgrade
```

Read the list of packages to remove before you answer `y`. When asked about a changed configuration file you edited (for example `sshd_config`), keep your version unless you need the new one. Press `D` to see the difference.

**4. Reboot**

```bash theme={null}
sudo reboot
```

> [!WARNING]
>
> Don't interrupt the upgrade or reboot while packages are being configured. If `full-upgrade` stops with "Could not perform immediate configuration", run `sudo apt full-upgrade -o APT::Immediate-Configure=0`. If SSH doesn't come back after the reboot, log in with the [VNC console](https://help.freakhosting.com/portals/vps-panel/how-to-enable-and-use-vnc-console-access.md) or [rescue mode](https://help.freakhosting.com/portals/vps-panel/how-to-use-rescue-mode.md).

## How to check it worked

```bash theme={null}
cat /etc/debian_version
grep VERSION= /etc/os-release
systemctl --failed
```

```text theme={null}
13.7
VERSION="13 (trixie)"
  UNIT LOAD ACTIVE SUB DESCRIPTION
0 loaded units listed.
```

The point release number (`13.x`) depends on when you upgrade.

## What to do after the upgrade

1. Remove unused packages: `sudo apt autoremove`.
2. Remove leftover config files of removed packages after reviewing them: `apt list '?config-files'`, then `sudo apt purge '?config-files'`.
3. Convert any remaining one-line sources to the deb822 format: `sudo apt modernize-sources`.
4. Re-enable third-party repositories with their trixie versions and run `sudo apt update`.
5. Test your websites, databases and apps.

### Changes in Debian 13 to know about

* `/tmp` is now a `tmpfs` in memory after reboot, and `/tmp` and `/var/tmp` are cleaned regularly. Don't store large or permanent files there.
* OpenSSH no longer supports DSA keys. Replace any `ssh-dss` keys before you upgrade, or you can't log in with them.

## Frequently asked questions

### Can I upgrade Debian 11 straight to 13?

No. Upgrade 11 to 12 first, reboot and check everything, then 12 to 13. Debian 11 is end-of-life, so a fresh install of Debian 13 is often simpler.

### Should I use apt or apt-get for the upgrade?

The release notes use `apt` for interactive upgrades. Use `apt-get` in scripts.

### How long does Debian 12 keep getting updates?

Now that Debian 13 is the stable release, Debian 12 is "oldstable" and its regular security support is time-limited, after which Debian LTS covers a subset of packages. Check [debian.org/security](https://www.debian.org/security/) and [wiki.debian.org/LTS](https://wiki.debian.org/LTS) for the current end dates, and plan the upgrade well before them.

### Is a reinstall better than an upgrade?

For a clean, simple server, an in-place upgrade works well. For a heavily customised server, a fresh Debian 13 install (VPS Panel [rebuild](https://help.freakhosting.com/portals/vps-panel/how-to-rebuild-and-reinstall-your-vps.md)) plus restoring your data can be faster to verify. A rebuild erases the disk.

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every server guide in one place.

> [card] [Upgrade Ubuntu to a new release](https://help.freakhosting.com/portals/other/how-to-upgrade-ubuntu-to-a-new-release.md)
>
> The Ubuntu version of this guide.

> [card] [Fix apt and dnf repository errors](https://help.freakhosting.com/portals/other/how-to-fix-apt-and-dnf-repository-errors.md)
>
> When apt update fails.

> [card] [Check your Linux version](https://help.freakhosting.com/portals/other/how-to-check-your-linux-version-and-system-info.md)
>
> Confirm the new release.

> [card] [Schedule and restore backups](https://help.freakhosting.com/portals/vps-panel/how-to-schedule-and-restore-backups.md)
>
> Back up before you start.

***

> [!NOTE]
>
> **Checked against the official [Release Notes for Debian 13 (trixie)](https://www.debian.org/releases/trixie/release-notes/), chapter "Upgrades from Debian 12 (bookworm)"** on 4 November 2026. A full release upgrade was not run in our test container (Ubuntu 24.04). Steps can differ on systems with third-party repositories.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.