Upgrade Debian 9 to Debian 10

Update ALL existing installed packages

Before you upgrade your Debian version to 10, you must apply all security patches and pending upgrades to Debian 9 itself Hence, Type the following apt command or apt-get command:

sudo apt update
sudo apt upgrade
sudo apt full-upgrade
sudo apt --purge autoremove

OR

sudo apt-get update
sudo apt-get upgrade
sudo apt-get full-upgrade
sudo apt-get --purge autoremove

Reboot the Debian 9.x stretch to apply the kernel and other updates:

sudo reboot

Update /etc/apt/sources.list file

Before starting the upgrade you must reconfigure APT’s source-list files. To view current settings using the cat command:

cat /etc/apt/sources.list

Sample outputs:

deb http://cdn-aws.deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main
deb http://cdn-aws.deb.debian.org/debian stretch-updates main

The stretch indicates that we are using an older version. Hence, we must change all the references in this file from Stretch to Buster using a text editor such as vim:

vi /etc/apt/sources.list

I prefer to use sed tool, but first backup all config files using the cp command:

sudo cp -v /etc/apt/sources.list /root/
sudo cp -rv /etc/apt/sources.list.d/ /root/
sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list
sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/*

see updated file now

cat /etc/apt/sources.list
APT source-list files updated to use buster

Updating the package list

Simply run:

sudo apt update

Minimal system upgrade

A two-part process is necessary to avoid the removal of large numbers of packages that you want to keep. Therefore, first run the following:

sudo apt upgrade

Just follow on-screen instructions. During the upgrade process, you may get various questions, like “Do you want to restart the service? ” OR “keep or erase config options” and so on. For example, I got a screen as follows indicating new changes:

Press ‘q‘ to exit and further you may see additional screens

Upgrading Debain 9 to Debian 10

In addition, minimum upgrades we need to do full upgrades to finish the whole Debian 9 to Debian 10 update process. This is the main part of the upgrade. In other words, execute the following command to perform a complete upgrade of the system, installing the newest available versions of all packages, and resolving all possible dependency:

sudo apt full-upgrade

Reboot the Linux system to boot into Debian Linux 10 buster, issue:

sudo reboot

Verification

It is time to confirm the upgrade. Run:

uname -r
lsb_release -a

Sample outputs:

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

Finally, clean up outdated packages using the apt command/apt-get command:

sudo apt --purge autoremove

Src: https://www.cyberciti.biz/faq/update-upgrade-debian-9-to-debian-10-buster/

Share

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.