Update Raspberry Pi to Raspbian Buster 10

Related: Full headless Raspberry Pi setup


Why upgrade

It’s worthwhile to upgrade to Debian Buster 10 to have Python 3.7 with system / GPIO libraries not always easy to install otherwise. It is generally not worthwhile to upgrade Raspbian in place–just copy off your files, do a fresh Debian install, and copy your files back. Keep the original SD card in case some setup is hard to figure out.

The best way to upgrade the Raspberry Pi operating system is get a new SD card and load with Raspbian from scratch as described below.

Copy any wanted files from Raspberry Pi ~ home directory to your PC with sftp or rsync. This is in case the original SD card fails.

The contents of the SD card are erased in the following procedure. We suggest getting a new SD card so that you have the original SD card with working configuration in case there’s an issue.

Download Raspbian Image ~ 400 Mbytes

wget https://downloads.raspberrypi.org/raspbian_lite_latest

Write Raspbian image to SD card. Before and after inserting the SD card into your PC, type

lsblk

Assuming the SD card was at /dev/mmcblk0 (use lsblk to find SD card mount point):

unzip -p *raspbian*lite* | sudo dd of=/dev/mmcblk0 bs=4M status=progress conv=fsync

The option conv=fsync prevents dd from instantly saying it’s done, helping avoid mistakenly removing the SD card before it’s done writing. This will take 5-10 minutes depending on your SD card speed.

sync

ensures the writing has completed.

Enable SSH by changing to the SD card boot directory, and type

touch ssh

before physically ejecting the SD card from your PC.

Headless Raspberry Pi first boot

Without a monitor and keyboard on the Pi, the Avahi dæmon on the Raspberry Pi will make it easy to find your Raspberry Pi when you plug into your LAN.

Note: changing the hostname of your Raspberry Pi also changes the Avahi address correspondingly.

Put the SD card into the Pi, plug an Ethernet cord into your LAN router/switch and from your PC:

ssh pi@raspberrypi.local

Update Pi software

apt install rpi-update
rpi-update
apt update
apt upgrade

Raspberry Pi Configuration

raspi-config

Raspberry Pi reliable long-term install tips

Avoid overclocking beyond one step above minimum. Use heatsink kit for high-stakes remote operations.