Related: Full headless Raspberry Pi setup
Why upgrade Raspberry Pi to Debian/Raspbian Stretch 9
It’s worthwhile to upgrade to Debian Stretch 9, to go from system Python 3.4 to 3.5, get QT5, etc. I found it was not worthwhile to upgrade Raspbian in place, as it took several hours and filled my 8 GB SD card. The best way to upgrade the Raspberry Pi operating system is to wipe (erase) the SD card and reload with Debian/Raspbian from scratch as described below.
- copy any wanted files from Raspberry Pi
~home directory to your PC with
sftpor rsync. The contents of your SD card are erased in the following procedure.
Download Raspbian Image
Write Raspbian image to SD card: before and after inserting the SD card into your PC, type
Assuming the SD card was at
lsblkto find SD card mount point):
unzip -p *raspbian*lite* | sudo dd of=/dev/mmcblk0 bs=4M status=progress conv=fsync
ddfrom 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.
ensures the writing has completed.
Enable SSH by changing to the SD card
bootdirectory, and type
eject the SD card from your PC.
Headless Raspberry Pi first boot
You don’t need a monitor and keyboard, 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:
Update Pi software
apt install rpi-update rpi-update apt update apt upgrade
Raspberry Pi Configuration
Raspberry Pi reliable long-term install tips
- avoid overclocking beyond one step above minimum.
- Use heatsink kit for high-stakes remote operations.