How to Upgrade from Debian 9 to Debian 10
Debian 10, codenamed "Buster," is the latest version of the popular Linux distribution. Released in July 2019, Debian 10 provides a wealth of new features and improvements over previous versions. Here are some highlights:
The kernel has been updated to Linux 4.19, offering better performance and support for modern hardware. This is a major version upgrade from Debian 9, which included Linux 4.9.
Debian 10 includes many security enhancements including an improved AppArmor parser, support for enhanced user-space hardening with stack clash protection, and hardened memory protections on architectures such as x86-64. There are also new tools to help harden services like SSH, Postfix and Apache2.
Improved Desktop Environment
On top of supporting the GNOME 3 desktop environment, Debian 10 also offers KDE Plasma 5 as well as Xfce as choices for users looking for an alternate desktop experience. All three environments offer improved usability over their predecessors along with the ability to customize them to suit user needs better.
Improved Package Management
Debian 10 includes a refreshed package management system that offers increased flexibility when installing and managing packages from repositories such as SNAP or Flatpak while still supporting classic .deb packages. Additionally, there are automated tools like aptitude to help simplify package management even further!
Before upgrading to Debian 10, you should do the following things:
- Back up all your files on the external drive.
- Make sure you have a stable internet connection.
- Disable any external repository.
In this article, I will show you how to upgrade from Debian version 9 to the new Debian 10 in a few easy steps.
- A server that is running Debian 9.
- A root password is configured on the server.
Update the System
First, you must update and upgrade all your system packages to the latest version. Run the following command to update and upgrade all packages:
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
Next, remove all unwanted packages with the following command:
Next, clean up the APT package cache with the following command:
Next, restart your system to apply all updates:
After restarting the system, verify your operating system version using the following command:
You should see a similar output:
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9 (stretch) Release: 9 Codename: buster
Update Debian 9 Repository with Debian 10
Next, you need to update the Debian 9 repository with Debian 10 to download and get the update.
To do this, you can update all source files by running these commands:
sed -i 's/stretch/buster/g' /etc/apt/sources.list
sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/*.list
Or edit the APT source file manually with the following command:
Replace "stretch" with "buster". The result should be similar to the one below:
deb http://deb.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian buster-updates main contrib non-free
deb http://deb.debian.org/debian buster-backports main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main
Save and close the file when you are finished if there are more APT source files in /etc/apt/sources.list.d/, edit these as well by replacing "buster" with "bullseye".
Upgrade Debian 9 to Debian 10
At this point, your Debian 9 server is ready for the upgrade.
First, update the repository to apply the changes you made in the previous step.
apt-get update -y
Now we will update existing packages without installing new ones:
apt upgrade --without-new-pkgs -y
Once your repository is updated, run the following command to start the upgrade:
apt-get full-upgrade -y
Once your system has been upgraded, restart it to apply all the updates.
Verify Debian 10 Upgrade
At this point, your Debian 9 server is upgraded to Debian 10. You can now verify it using the following command:
You should see the Debian 11 version in the following output:
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: bullseye
The above guide explains how to upgrade from Debian version 9 to Debian 10. I hope you can now upgrade your Debian 10 without any hassle.