Safely upgrade from Debian 9 to Debian 10

It is jarring when you come across VPS providers in mid-2020 and they only provide up to Debian 9 (or Debian 8) for the OS image. Fortunately, it can be easily upgraded via a few commands, as depicted in this article.

First, open and edit the repository list at /etc/apt/souces.list:

nano /etc/apt/sources.list

Change all the references from Stretch to Buster. Your VPS provider may provide additional packages, but here is what the sources.list would look like from a fresh Debian 10 install:

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

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

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

After which, update the local package list, update the software packages, and perform a distribution upgrade:

apt update
apt upgrade
apt dist-upgrade

Finally, reboot the system and viola! Your OS is now upgraded to Debian 10 Buster 🙂


Comments

Leave a Reply