How to Upgrade Debian 9 to 10 on Linode

Linode Staff

I just found out that I'm using Debian 9. How can I upgrade this to 10 or 11? I've tried updating but it failed.

1 Reply

Hi there,

The following steps will allow you to upgrade your Debian version. In this example, I will upgrade a Debian 9 (Stretch) Linode to Debian 10 (Buster). This will also work for Debian 11 (Bullseye).

Before doing so, always backup your Linode! See Backing Up Your Data for help with this.

First, let's check what release your system is currently rocking.

cat /etc/*release

Then let's update the current system utilizing the existing repositories.

sudo apt update && sudo apt upgrade

Keep in mind, if you're logged in as root, you don’t need to use sudo.

At this point, you have an up-to-date system on the current Debian release. Now we can upgrade to the newest release!

Use your favorite text editor to modify the /etc/apt/sources.list file.

Since we’re rocking Debian 9, the configuration file uses Stretch. We will change this to Buster. If you’re upgrading to Debian 11, use Bullseye.

This is the before:

deb http://mirrors.linode.com/debian stretch main
deb-src http://mirrors.linode.com/debian stretch main

deb http://mirrors.linode.com/debian-security stretch/updates main
deb-src http://mirrors.linode.com/debian-security stretch/updates main

# stretch-updates, previously known as 'volatile'
deb http://mirrors.linode.com/debian stretch-updates main
deb-src http://mirrors.linode.com/debian stretch-updates main

This is the after:

deb http://mirrors.linode.com/debian buster main
deb-src http://mirrors.linode.com/debian buster main

deb http://mirrors.linode.com/debian-security buster/updates main
deb-src http://mirrors.linode.com/debian-security buster/updates main

# buster-updates, previously known as 'volatile'
deb http://mirrors.linode.com/debian buster-updates main
deb-src http://mirrors.linode.com/debian buster-updates main

Save, or write out, the updated file and return to the command line.

Now run sudo apt update to update the repositories.

Once completed, run a minimal system upgrade sudo apt upgrade. Depending on your system, this step may take a while.

Hit yes or keep the local version currently installed to the package configuration, fullscreen prompts. When prompted to review changes, scroll down and hit q.

Once the minimal basic upgrade completes, now run sudo apt full-upgrade to run a full system upgrade.

Upon completion, reboot the system.

sudo init 6

This reboot may take a few minutes.

Once the system has rebooted, verify the upgrade by cat-ing the release file.

cat /etc/*release

The output should display Buster or Bullseye and the associated version.

[email protected]:~# cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Congratulations! You have successfully upgraded your Debian system to a newer distribution.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct