Loading...
Loading...
Marco Franssen

In this post, I want to keep a concise record of how I upgraded a Raspberry Pi from Raspbian Stretch to Raspbian Buster.
First, check that your current version is Raspbian Stretch. The easiest way is to enter the following command in your 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"If the output shows version 8 (jessie), follow my Jessie-to-Stretch guide first. If it shows version 9 (stretch), continue below.
First, I make sure all available patches are installed on the current version. I always do this to reduce the risk of problems caused by outdated packages.
sudo apt update && sudo apt upgradeNext, I'll update the APT sources to use the Buster repositories. You can manually replace stretch with buster in /etc/apt/sources.list and the relevant /etc/apt/sources.list.d/* files, or use the sed commands below. Check the result with cat, if only for your peace of mind.
$ 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 uiNow you can start the upgrade. It may take a couple of hours, depending on your network speed, so make sure you have time for the remaining steps. You'll need to answer a few prompts along the way. In my case, I encountered a broken package and fixed it with apt --fix-broken install. You may not need that command if you don't encounter the same issue.
sudo apt upgrade
sudo apt --fix-broken install #only if you got a broken package install in previous step
sudo apt upgrade-distNext, as recommended by the Raspberry Pi team, remove the following packages, which are installed with Buster but can't be used on your Raspberry Pi. I also clean up APT with the second and third commands. Since this is a distribution upgrade, I finish with a reboot.
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 rebootFinally, check your OS release. It should now show version 10 (buster).
$ 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"Here's the command sequence for upgrading your Raspberry Pi to Raspbian Buster. I've added the -y flag to the package commands to automatically confirm prompts.
$ 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 rebootAfter rebooting, check your OS version once more. It should show version 10 (buster).
$ 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 this guide with your friends.
Marco Franssen
Set up Git, Vim, and Bash on Raspbian, mount NFS shares from a Synology NAS, and configure Kodi to start automatically on your Raspberry Pi.
Marco Franssen
Flash a Raspbian image with Etcher, enable SSH, update packages, and configure Wi-Fi with a static IP in this Raspberry Pi Stretch setup walkthrough.
Marco Franssen
Create reusable Go web server boilerplate with chi routing, structured zap request logs, and graceful shutdown that lets active requests finish.
Marco Franssen
Build a Go API with the Elasticsearch 7 client, run a local cluster with Docker Compose, and add index creation and search to a practical demo.