Raspian | Upgrade from Stretch to Buster

I use my Raspberry PI 4 Model B for different kind of private projects. Today I want to upgrade it to the new Buster version. This is the first time I do it for the Raspberry, but not for a Debian distribution at all. See my article Upgrade Debian from Jessie to Stretch.

Why should I do the upgrade?

The most important part is, that the old version is going to die and you won’t get any updates when the long time support ends for Stretch. Especially, the security updates are important. But don’t be afraid, the changes are not fundamental. The biggest changes are the appearance of the user interface (UI) and that the UI is now drawn with OpenGL.


Firstly you should decide if you want to do an upgrade or to make a clean installation. If a clean installation is not an option for you, you have to make a backup! If anything goes wrong you don’t lose all your data. I don’t take the responsibility for it

If you are not sure, which version you are running you can take a look into the /etc/os-release file and check if version codename is stretch.

Let’s start

You should update and upgrade your current installation with the latest version by running the following commands.

# apt-get update
# apt-get upgrade
# apt-get dist-upgrade

After this upgrade, you need to check if the installed packages are done and if they are in an upgradable status. Run the following commands and it will show you any package which is not ready to upgrade. Fix the broken package before you proceed.

# dpkg --audit
# dpkg --get-selections | grep 'hold$'

Now, the upgrading process starts. Open the /etc/apt/sources.list file with the editor of your choice and change the keyword stretch to buster. The snippet shows my file

deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

Do the same step for the file located at /etc/apt/sources.list.d/rasp.list. See my file again:

deb http://archive.raspberrypi.org/debian/ buster main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://archive.raspberrypi.org/debian/ buster main ui

Save the file and run the command to update the package list. Then we can check if the packages are upgradable.

# apt-get update
# apt list --upgradable

Now we are running a two-part update process. The first update installs packages where no other packages need to be removed or installed. The second part performs a full upgrade, with resolving dependencies between different releases. The second part takes a long time. So lean back and watch your favourite movie.

// Part one
# apt-get upgrade

// Part two
# apt full-upgrade

During the full-upgrade, you have to answer some questions. Most of them are related to your customized files. Unfortunately, my upgrade run into the following error

Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Fortunately, I could solve the issue by running the sudo apt --fix-broken install command. After the upgrade you should reboot the system and verify your version:

# reboot
# cat /etc/os-release

One last step is necessary to complete the upgrade. Remove not used applications from your installation by using the following command

sudo apt purge timidity lxmusic gnome-disk-utility deluge-gtk evince wicd wicd-gtk clipit usermode gucharmap gnome-system-tools pavucontrol

I hope your installation was successful and you have learned some new stuff. Enjoy your Raspbian Buster version and if you’re looking for some more Raspian Buster information check out the following links:

Stay safe, let a comment and hit the like button if you like my article.


Join the conversation

comment 2 comments
  • Remco

    Thanks for your instructions, it worked in the end, although I was unable to connect to the Pi after reboot through my SSH client. It turned out that the Pi didn’t have a functioning network connection, because after reboot Buster was using Wicd as a networking manager, which didn’t properly function. Exactly why it has to be purged. Luckily I could still log in to the Pi directly, and then do the purging. Therefore I would suggest to change your instructions likewise, so first do the purging and then (sudo apt autoremove -y followed by sudo apt autoclean and then) do the reboot.

    • Denis

      Hi Remco,
      thank you for your feedback. I hadn’t this issue, but I will add your suggestion to the article.

Leave a comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.