Upgrade Raspbian jessie 8 to stretch 9

Here are a few simple copy and past steps to upgrade your current Raspbian 8.0 (jessie) to the latest Raspbian 9.1 (stretch). This was done on a Raspberry pi 3.

PRE
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie

UPDATE & UPGRADE ANY PACKAGES IN THE CURRENT VERSION
$ sudo apt-get update
$ sudo apt-get upgrade

UPDATE ANY PACKAGES HELD BACK BY THE DISTRO
$ sudo apt-get dist-upgrade

CHECK TO MISSING OR OBSOLETE PACKAGES
$ sudo dpkg -C

CHECK FOR PACKAGES ON HOLD THAT WILL NOT BE UPGRADED DUE TO INCONSISTENCY
$ sudo apt-mark showhold

UPDATE YOUR SOURCE LIST FROM JESSIE TO STRETCH WITH A SIMPLE SED COMMAND
$ sudo sed -i ‘s/jessie/stretch/g’ /etc/apt/sources.list

UPDATE THE PACKAGE LIST AGAIN WITH THE NEW STRETCH SOURCE
$ sudo apt-get update

POTENTIALLY YOU CAN SIMULATE THE UPGRADE TO SEE IF THERE ARE ANY ISSUES
$ sudo apt-get –simulate upgrade

FINALLY DO THE ACTUAL UPGRADE OF ALL PACKAGES
$ sudo apt-get upgrade

UPGRADE DISTRO PACKAGES NOT UPGRADED WITH ALL THE OTHER PACKAGES
$ sudo apt-get dist-upgrade

RUN THE FIX-BROKEN IN CASE THERE INCONSISTENCY CAUSED BY THE UPGRADE
$ sudo apt –fix-broken install

CLEAN UP ALL THE OLD PACKAGES NO LONGER REQUIRED
$ sudo apt autoremove
$ sudo apt-get clean

POST
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.1 (stretch)
Release: 9.1
Codename: stretch

Enjoy it and please let me know what you think @gcclinux on twitter

Donate




Leave a Reply