Before doing the upgrade make sure to backup all important files, to avoid any data loss. For this tutorial we’ll only cover the upgrade process, check this tutorial for database

Install tmux

We’ll run the all command under tmux, to make sure the upgrade process keep going even though we have some issue with internet connection.

sudo apt install tmux -y

run tmux from terminal, then connect to linux via SSH
tmux then ssh
in case the connection drop, open the tmux session again using command

tmux attach

Update Debian 12 (bookworm)

Update all packages for current Debian to the latest version

sudo apt update && sudo apt full-upgrade -y

after done, restart the system

sudo reboot

Upgrade to Debian 13 (trixie)

Update main repository to trixie

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

Update third party repository to trixie

sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \;

then update and upgrade the whole packages

sudo apt update && sudo apt full-upgrade -y

it’ll take sometimes to upgrade the packages. After everything done, reboot the server to finalize the upgrade process.

sudo reboot

upgrade debian 12 to debian 13

Leave a comment

Your email address will not be published. Required fields are marked *