Debian 10, codenamed Buster, was released on July 6, 2019. This tutorial is going to you how to upgrade Debian 9 to Debian 10 from command line. You can follow this tutorial on a Debian 9 desktop, or Debian 9 server. As with every Debian release, Debian 10 will be supported for 5 years. The codename “Buster” is named after Andy’s dog in the Toy Story movie.

Recommendation

If you installed the proprietary Nvidia driver on Debian 9 desktop, I recommend removing it before the upgrade because the Nvidia driver caused package conflict when I attempted to upgrade Debian stretch to buster.

sudo apt remove *nvidia*

Upgrade Debian 9 Stretch to Debian 10 Buster Using Command Line

You can use command line to upgrade Debian desktop or a headless server. If you use SSH to log into your Debian server, it’s a good idea to keep your OpenSSH session alive by adding the following line in /etc/ssh/sshd_config file on your server.

ClientAliveInterval 60

Save and close the file. Then restart SSH daemon.

sudo systemctl restart ssh

To upgrade to Debian 10, switch to root user with the following command. You will need to enter the root user’s password.

su -

Then update existing software using the following two commands.

apt update

apt upgrade

If a new kernel is installed when running the above command, then you need to reboot the system to in order to continue the upgrade process. To reboot Debian, run the following command. (Remember to switch to root user again after the reboot.)

shutdown -r now

Next, we need to edit the sources.list file with a command line text editor such as Nano.

nano /etc/apt/sources.list

Change all instances of stretch to buster. If you don’t like changing it one by one, then you can exit out of Nano text editor (Press Ctrl X) and run the following command for batch replacement.

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

Then we need to disable third-party repositories with the following command, which will add a # character at the beginning of line for every .list file in /etc/apt/sources.list.d/ directory.

sed -i 's/^/#/' /etc/apt/sources.list.d/*.list

Next, update software sources and upgrade software to the latest version available in the buster repository. This step is called minimal upgrade.

apt update

apt upgrade

If you see the following error,

The following packages have unmet dependencies:
 inetutils-ping : Conflicts: ping

Then you can uninstall inetutils-ping.

apt remove inetutils-ping

And run apt upgrade command again. If the apt-listchanges shows up during the upgrade, you can press the Q key to return to the main screen.

When upgrading packages, you will be asked if you want to restart services without asking. If you want to manually restart services, choose No. This tutorial choose Yes, because my Debian box doesn’t have a service that needs to be accessed by the public.

You will also likely to be asked if you want to install new version of configuration files. I always choose No (Just press Enter) to be on the safe side. (The new configuration file will be saved with the same file name but with the .ucf-dist or .dpkg-dist extension, which you can examine after the upgrade.)

Once minimal upgrade is finished, run the following command to begin full upgrade.

apt dist-upgrade

Now you can remove obsolete/unneeded software packages from your Debian system.

apt autoremove

apt clean

Finally, reboot the system.

shutdown -r now

Check your Debian version.

lsb_release -a

You should see the following text.

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

Congrates! You have successfully upgraded to Debian 10 Buster.

Next Step

I hope this tutorial helped you upgrade Debian 9 to Debian 10. You can also attend a Debian release party to celebrate it! As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂

Rate this tutorial

[Total: 4 Average: 5]