Skip to main content

Upgrading Debian Version

Upgrading Debian from one version to the next is actually a simple, straight forward process. All you have to do is change the apt source repository from one Debian version to the next one, and update!

As with any major system upgrades, make sure you backup your configs and important files! If you are upgrading a VM, take a snapshot first. 

Upgrading from Debian 11 Bullseye to Debian 12 Bookworm

First, check your Debian version by running the following command, or run neofetch if you have that installed:

cat /etc/os-release

Screenshot 2023-06-11 124429.png

Next, make sure your current system is fully up to date.

sudo apt update && sudo apt upgrade -y

Screenshot 2023-06-11 124718.png

Check your current apt package manager source list:

cat /etc/apt/sources.list

You will see that the source repository will say Bullseye (for Debian 11). 

Screenshot 2023-06-11 124821.png

Upgrading Debian is as simple as replacing the current repository source (Bullseye) to the newer version's repository source (Bookworm). So in the above source file, replace all instance of "bullseye" with "bookworm" using an editor like nano, or run the following command to search and replace:

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

Afterwards, you can run "cat /etc/apt/sources.list" again to check that all instances of "bullseye" is replaced with "bookworm".

Screenshot 2023-06-11 124916.pngScreenshot 2023-06-11 124929.png

Now you can update the repository.

sudo apt update

Screenshot 2023-06-11 125003.png

To start the upgrade, run the following:

sudo apt full-upgrade

Screenshot 2023-06-11 125026.png

At some point in the upgrade process, you will be presented with the apt change list. Press Q to exit the change-list. 

Screenshot 2023-06-11 125435.png

Choose Yes to allow the upgrade to auto-restart services.

Screenshot 2023-06-11 125456.png

Type N to keep your current, customize config. Otherwise, you can type Y to reset and use the default config.

Screenshot 2023-06-11 125852.png

Once done, reboot your system.

sudo reboot

After reboot, you can check that your system is upgraded by checking /etc/os-release, or run neofetch.

cat /etc/os-release

Screenshot 2023-06-11 130649.png

Lastly, you can run the following to remove any old and unnecessary packages:

sudo apt autoremove -y

Screenshot 2023-06-11 130731.png

That's it!