Blog.

Upgrading Raspbian Stretch to Raspbian Buster

Marco Franssen

Marco Franssen /

4 min read692 words

Cover Image for Upgrading Raspbian Stretch to Raspbian Buster

In this blog I want to note down in the shortest way possible how to upgrade your Raspberry Pi from Raspbian Stretch to Raspbian Buster.

First check your current version of Raspbian is Raspbian Stretch. The easiest way to do this is enter the following in your terminal.

terminal
$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

In case it states version 8 (jessie) you can check out following blog first to upgrade first to Raspbian Stretch from Jessie. In case your output is version 9 (stretch) please continue below.

First I ensure at least all patches are installed on my current version. I always do this to reduce risks which might be caused due to very outdated packages.

sudo apt update && sudo apt upgrade

Next I will update my apt sources to use the new buster repos. You could do this manually by replacing stretch with buster in your /etc/apt/sources.list.d/* files, or you simply use below command that replaces it in an very simple straight forward way using sed. With cat you can validate the outcome of the file, just for the sake of your peace of mind.

terminal
$ sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list
$ sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list
$ cat /etc/apt/sources.list.d/raspi.list
deb http://archive.raspberrypi.org/debian/ buster main ui staging
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ buster main ui

Now you can start to do the upgrade. This might take a couple of hours depending on your network speed. So make sure you have the time to continue on next steps. You will have to confirm and make a choice a couple of times. In my case I also got a broken package which I fixed using the apt --fix-broken install. You might not face this issue and therefore not require to execute this command.

terminal
sudo apt upgrade
sudo apt --fix-broken install #only if you got a broken package install in previous step
sudo apt upgrade-dist

Last but not least as recommended by the guys from Raspberry you can remove the following packages which are installed with Buster, but can't be used on your Raspberry Pi. I also always clean up apt see the second and third command. As we did a distribution update I also give it a reboot.

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

Last but not least you can now verify your os release, which should now state version 10 (buster).

terminal
$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Summary

Summarized it boils down to the following set of commands to upgrade your Raspberry Pi to Raspbian Buster. To do this fully unattended I have added the -y flag on all commands.

terminal
$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
$ sudo apt update && sudo apt upgrade -y
$ sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list
$ sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list
$ sudo apt update && sudo apt upgrade -y
$ sudo apt --fix-broken install #only if you got a broken package install in previous step
$ sudo apt dist-upgrade -y
$ sudo apt purge -y timidity lxmusic gnome-disk-utility deluge-gtk evince wicd wicd-gtk clipit usermode gucharmap gnome-system-tools $ pavucontrol
$ sudo apt autoclean -y
$ sudo apt autoremove -y
$ sudo reboot

Once rebooted you can verify once more your os version, which should now state version 10 (buster).

terminal
$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

References:

Thanks for reading, please share with your friends.

You have disabled cookies. To leave me a comment please allow cookies at functionality level.

More Stories

Cover Image for Install fresh Raspbian image on your Raspberry Pi - part 2

Install fresh Raspbian image on your Raspberry Pi - part 2

Marco Franssen

Marco Franssen /

In the previous blog of this series I explained the basics of getting a fresh installation of Raspbian on your Rapberry Pi including SSH access and configuration of a static IP for your Wifi. In this blog we are going to have a look at tweaking it a little further to get a better commandline experience and have some more tooling available to operate your Raspberry Pi. Admin experience and tooling On any server I will most likely always work with Git and Vim. I have many of my bash scripts and…

Cover Image for Install fresh Raspbian image on your Raspberry Pi - part 1

Install fresh Raspbian image on your Raspberry Pi - part 1

Marco Franssen

Marco Franssen /

In my last blog I shown you how to upgrade from Raspbian Stretch to Raspbian Buster. As the whole upgrade went smooth it seems there are still some issues with Raspbian Buster. The one which blocked me completely was the ability to run Kodi. Kodi was not able to start due to a GUI error. Therefore I decided to switch back to Raspbian Stretch until Raspbian Buster packages catch up. Prerequisuites Before you start a fresh install make sure you have an ethernet cable at hand, as we will need it…

Cover Image for Improved graceful shutdown webserver

Improved graceful shutdown webserver

Marco Franssen

Marco Franssen /

In a previous blogpost I wrote how to create a Webserver in Go with graceful shutdown. This time I want to show you a more improved version which you can utilize better in your projects as it can be used as a drop in server.go file in your project where I also make use of some popular high performing libraries. In previous example I coded the full example in main.go. Although nothing wrong with that I learned while building microservices for a while it would be more convenient for me if I could…

Cover Image for Go client for Elasticsearch using Docker

Go client for Elasticsearch using Docker

Marco Franssen

Marco Franssen /

In this blog post I would like to cover the recently released Elasticsearch 7.0-rc1 Go client for Elasticsearch. In this blogpost I want to show you a small example with a simple Docker setup using to build a Elasticsearch cluster. In my previous blogpost I covered some Docker tips and tricks we will utilize again in this blog post. Initializing your project To start with we first have to create a project folder. In this folder we will have to initialize our Go module, add our Dockerfile and…