How to upgrade from Debian 11 to Debian 12

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Hello, friends. But now you will learn how to upgrade from Debian 11 to Debian 12. It’s simple, but you have to be careful.

Upgrading from Debian 11 to Debian 12

Debian 12 comes as always with many new features, thousands of updated packages and revamped desktop environments. So, it is no exaggeration to say that Debian 12 is one of the releases of the year.

In addition to this, Debian 12 comes with a new policy for handling proprietary drivers that will make it easier to install.

Preliminary Considerations

Before starting, it is always a good idea to make a full backup of your most important data. It is also good to consider whether you really need the upgrade or a clean installation.

In any case, the backup should be done to prevent possible problems. Another issue to consider is the external repositories you have added. My advice is to remove them before upgrading.

Upgrading from Debian 11 to Debian 12

The first thing to do is to upgrade the whole system. To achieve this, open the terminal and run.

sudo apt update
sudo apt upgrade
sudo apt full-upgrade

Thereafter, remove those that are unnecessary.

sudo apt --purge autoremove

To apply the changes that may have been made, it is best to reboot the system

sudo reboot

Preparing the repositories for Debian 12

Now you have to touch the system repositories and point them to Debian 12. First, make a backup of the file.

sudo cp /etc/apt/sources.list /opt/sources.list.bak

Or any location you like. It is even a good idea to have a backup outside the computer.

Then, replace in the repository file replace in each entry bullseye by bookworm so that it points to the new version.

You can do this manually by editing the file or by executing

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

However, in this version of Debian, you also have to add the non-free-firmware entry to have proprietary drivers available. An example of how the repository file should look like is as follows.

deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free non-free-firmware
deb http://deb.debian.org/debian-security/ bookworm-security bookworm-security main contrib non-free non-free-firmware
source.list file ready for Debian 12
source.list file ready for Debian 12

Refresh APT to apply the new repositories

sudo apt update

Upgrade to Debian 12

With the repositories ready, you can upgrade to Debian 12 by running

sudo apt full-upgrade
Upgrade to Debian 12 from Debian 11
Upgrade to Debian 12 from Debian 11

During the process, you will see a screen showing the changes to come. Press q to continue.

From here on, it is a matter of following the instructions on the screens you will see. To accelerate the process, tell the wizard that it can restart services without consulting you.

Upgrading process
Upgrading process

In some of them, you will be asked to choose whether to replace configuration files such as SSH versions with current ones. To keep everything running smoothly, keep the same version.

Keep the same version config file on the installation
Keep the same version config file on the installation

When finished, restart Debian.

Now, check that everything went well. Open a terminal and run.

lsb_release -a

Or

uname -rms
Debian 12 working properly
Debian 12 working properly

Done!

Conclusion

Now that you know how to get Debian 12 from Debian 11, you can use it on your computer, but remember to use caution.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Angelo
Angelo
I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook