Blog.

Upgrade Raspbian Jessie to RaspbianStretch

Marco Franssen

Marco Franssen /

4 min read740 words

Cover Image for Upgrade Raspbian Jessie to RaspbianStretch

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.

terminal
cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
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 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.

terminal
sudo apt update
sudo apt -y upgrade

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.

terminal
sudo rpi-update
sudo reboot now

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.

terminal
sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list
sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list.d/raspi.list

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.

terminal
sudo apt update
sudo apt -y dist-upgrade

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.

sudo apt-get -y purge "pulseaudio*"

Now it is time to reboot and say some prayers or do whatever you do at such moments (grabbing a coffee).

sudo reboot now

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.

terminal
sudo apt update
sudo apt -y upgrade
sudo apt -y autoremove
sudo apt -y autoclean

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.

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"
You have disabled cookies. To leave me a comment please allow cookies at functionality level.

More Stories

Cover Image for Merge multiple gradle projects including git history

Merge multiple gradle projects including git history

Marco Franssen

Marco Franssen /

As we started 2 years ago with a micro-service architecture we faced some issues in the productivity of the teams a while ago. This made me think what we could do about that from an architecture and development point of view. As we used different Git repos for the various components of our micro services in the long run it became harder and harder for developers to work with those components. At that point in time I decided to simplify the development workflow to merge the different Git repos…

Cover Image for Responsive Adaptive Progressive impressive webpages

Responsive Adaptive Progressive impressive webpages

Marco Franssen

Marco Franssen /

In the last couple of years web applications technologies and frameworks went through a fast paced transformation and evolution. For all these evolutions there was coined a marketing term which (by coincidence) all end on …ive. So lets coin another one. In this article I'm going to explain you the basic concepts of all these principles which combined allow you to build an impressive web application. Responsive Web Design It started all back in (from top of my head) late 2010, with the idea o…

Cover Image for Using docker-compose for multi Docker container solutions

Using docker-compose for multi Docker container solutions

Marco Franssen

Marco Franssen /

In this article I want to show you the way for running your multi container solution on Docker. Docker Compose is a tool for defining and running multiple Docker containers using a single command. With Compose, you use a docker-compose file to configure your applications services. Then, using a single command, you create and start all the services from your configuration. In a previous article I have shown you how to setup a Docker development environment on Windows or Mac. In case you don't…

Cover Image for Run your Angular app in a Nginx Docker container

Run your Angular app in a Nginx Docker container

Marco Franssen

Marco Franssen /

Today you will learn how we can package our static html Angular app in a Docker container running Nginx. By packaging our app in a Docker container we will benefit from the fact that we will have some immutable infrastructure for our app. Immutability will give you many benefits when it boils down to maintaining a platform. Things that can not change state also can't lead to surprises in a later stage. Immutability is also well known in functional programming languages. I won't list all the adva…