How To Upgrade From Debian 9 Stretch to Debian 10 Buster

Debian 10 Buster was released on July 6th, 2019, and you may be now looking for upgrading your previous version, i.e., Debian 9 “Stretch” to the latest version Debian 10 “Buster”.

This post will help you to upgrade your system from Debian 9 Stretch to Debian 10 Buster.

Prerequisites

Internet

You must have an active internet connection to download packages for OS upgrade.

Sudo Access

You must have a root or sudo privileges to perform this OS upgrade.

Backup

Before upgrading your system, request you to take a full backup of important data files and configuration files as the backup may help us restoring the system to its previous state if you face any issues during the upgrade.

Example,

  • Databases
  • Configuration files
  • Important application data files

Upgrade From Debian 9 to Debian 10

Test this Debian OS upgrade on development systems before upgrading the production systems.

Verify current version

Use the lsb_release -a command to see the current version of Debian.

Distributor ID: Debian
Description:    Debian GNU/Linux 9.8 (stretch)
Release:        9.8
Codename:       stretch

Update Debian 9

Update all the installed packages to the latest version available for the current operating system Stretch.

sudo apt update

sudo apt upgrade

Modify sources.list File

Take a backup of current sources.list file.

sudo cp /etc/apt/sources.list /etc/apt/sources.list_bkp

Now, edit the apt configuration file /etc/apt/sources.list and replace stretch with buster. Use the sed command to update the repository file in a single go.

sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list

The content of the file will look like below after updating it with “buster“.

deb http://ftp.us.debian.org/debian/ buster main
deb-src http://ftp.us.debian.org/debian/ buster main

deb http://security.debian.org/debian-security buster/updates main contrib
deb-src http://security.debian.org/debian-security buster/updates main contrib

# buster-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ buster-updates main contrib
deb-src http://ftp.us.debian.org/debian/ buster-updates main contrib

Update the package index.

sudo apt update

Preview upgrade

Use the apt list –upgradable command to quickly list what will be installed, updated, and removed during the OS upgrade process without affecting the system.

sudo apt list --upgradable

Output:

xwayland/stable 2:1.20.4-1 amd64 [upgradable from: 2:1.19.2-1+deb9u5]
xxd/stable 2:8.1.0875-5 amd64 [upgradable from: 2:8.0.0197-4+deb9u3]
xz-utils/stable 5.2.4-1 amd64 [upgradable from: 5.2.2-1.2+b1]
yelp/stable 3.31.90-1 amd64 [upgradable from: 3.22.0-1]
yelp-xsl/stable 3.31.90-1 all [upgradable from: 3.20.1-2]
zeitgeist-core/stable 1.0.1-1 amd64 [upgradable from: 0.9.16-0.2+b1]
zenity/stable 3.30.0-2 amd64 [upgradable from: 3.22.0-1+b1]
zenity-common/stable 3.30.0-2 all [upgradable from: 3.22.0-1]
zlib1g/stable 1:1.2.11.dfsg-1 amd64 [upgradable from: 1:1.2.8.dfsg-5]

Upgrade to Debian 10

Now, upgrade all packages on your system to the latest version available for Debian 10 Buster.

sudo apt upgrade

During the upgrade, services installed on your system needs to be restarted after the up gradation of each service packages (ex. Apache, NTP) which may cause you service interruptions.

You can choose to restart automatically during upgrade or manually after the upgrade. Here, I choose to do an automatic restart of services during the OS upgrade.

Upgrade From Debian 9 Stretch to Debian 10 Buster – Restarting services

Do the distribution upgrade to complete the upgrade to Debian 10.

sudo apt dist-upgrade

Verify upgrade

Reboot your machine after the distribution upgrade.

sudo reboot

Verify the current version of the Debian operating system.

lsb_release -a

Output:

Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

Conclusion

That’s All. You have upgraded Debian 9 to Debian 10 successfully. Share your feedback in the comments section.

debian 10debian 9upgrade
Comments (0)
Add Comment