Upgrade Debian 9 Stretch to Debian 10 Buster
This guide explains how to upgrade your Debian Linux system from Debian 9 (Stretch) to Debian 10 (Buster) which is now the current stable distribution as of July 6th, 2019.
These steps can be preformed as an in place upgrade on a live system from either a local terminal or remote SSH session.
Prior to upgrading, make sure the current system is up-to-date.
apt update && apt upgrade
Begin the upgrade by switching Debian repositories from Stretch to Buster. This is accomplished in one of two ways; using the sed command to search and replace all instances automatically, or by editing the source file manually. Choose whichever option you prefer.
Search & Replace with sed.
sed -i 's/stretch/buster/g' /etc/apt/sources.list
Or edit your source list manually.
Replace all instances of "stretch" with "buster", for example.
deb http://deb.debian.org/debian stretch main deb-src http://deb.debian.org/debian stretch main deb http://deb.debian.org/debian-security/ stretch/updates main deb-src http://deb.debian.org/debian-security/ stretch/updates main deb http://deb.debian.org/debian stretch-updates main deb-src http://deb.debian.org/debian stretch-updates main
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
Note: Debian is distributed (mirrored) on hundreds of servers worldwide. In our source.list example above we've used a repository within the United States, to speed up downloads you may choose another Debian mirror based on geographic location.
Update the package index.
Upgrade the minimal base system.
Upgrade all other packages and dependencies.
Reboot the system.
Verify your release has been upgraded.
Output will be similar to this.
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster
Clear out the local repository of retrieved package files and dependencies that are no longer required.