Upgrade Raspbian Jessie to RaspbianStretch
Marco Franssen /
4 min read • 747 words
Very recently I have upgraded my Raspberry 3 to the new Raspbian OS, code named "Stretch". Due to some security issues in the chipset of the Raspberry Pi 3 and Raspberry zero, I decided to upgrade mine to Raspbian Stretch, which resolves these security issues.
Before you get yourself into any trouble make sure to have a backup of any important data and also please note I can't be responsible for any data loss. In this guide I also assume you know how to connect to your raspberry using ssh and how to use the commandline.
First check if you are running Raspbian Jessie release as following guide only is tested by upgrading from Jessie. You can check this using the following command.
In case you are not running Raspbian Jessie 8.0, I can't guarantee following guide will work. If you are brave enough to continue please let me and other readers know in the comments below if it also works for prior Jessie versions.. Once again make sure important data is backed up.
Before starting the upgrade I recommend to first make sure your current version Raspbian Jessie has all packages upgraded. You can do so by running following commands.
Then before upgrading the Raspbian distro I also first did an upgrade of my raspberry firmware which can be done using following command. It upgrades the kernel VideoCore lib etc. A reboot is required after the firmware update.
Now it is time to prepare for the distro upgrade to start using Raspbian Stretch. For that we have to change the apt sources to point to the Raspbian Stretch apt repositories. For that we have to change the following 2 files /etc/apt/sources.list
and /etc/apt/sources.list.d/raspi.list
by replacing jessie with the word stretch. You can do that manually using vim or use following command to get the text automatically replaced.
Now we have upgraded the apt repositories to Raspbian Stretch we are ready to run the upgrade. Please note this can take a while as it has to download all the new binaries which is a few hundred MB at least. Do note your input is required a few times during the installation process so do check every few minutes to keep the upgrade going. Also consider donating some CPU cycles using the widget on my sidebar while waiting for the upgrade, to support the hosting costs of my webpage.
According to resources on raspberryppi.org the bluetooth pulseaudio package in Raspbian Jessie was a bit clumsy. This has been improved by using the replacement bluez-alsa package in Raspbian Stretch.
Now with the upgrade done it is time to remove pulseaudio as this package is replaced with bluez-alsa package in Raspbian Stretch to make bluetooth audio work with ALSA. So unless you build your own stuff on top of pulseaudio we can remove this package using following command.
Now it is time to reboot and say some prayers or do whatever you do at such moments (grabbing a coffee).
After rebooting the Pi I also recommend to do one more check for package updates and remove old packages running following commands. This saves some storage, plus I like to have my servers clean and tidy.
That was all. You got your Raspberry fully updated now with latest security patches for the chipsets as well running latest stable Raspbian version. Please leave a comment below on your findings. Don't hesitate to ask any questions, and for the brave ones who ofcourse took that backup before jumping into the deep, please share your feedback if this guide also covers upgrading from earlier versions of Raspbian.