Upgrading to Raspbian Jessie

Thu 01 September 2016

I got a nasty surprise a few days ago when I found out that Raspbian Wheezy (the OS running on my Raspberry Pi) was effectively EOLed when Jessie came out in September 2015. I had assumed that, being based on Debian, it would receive security updates until 2018. But due to shortage of resources and manpower the raspbian team have decided to move straight over to Jessie, which makes sense.

Unfortunately that means I have been running my Pi without any security updates for almost a year. Since I now use the Pi (hooked up to a large USB hard drive) as my primary home server and also have SSH access to it from the outside world this made me break out in a cold sweat. I only allow public key authentication for SSH but a year is a long time to go without security updates in the internet age for any type of server accessible over the internet. I had to get over to Jessie ASAP.

I knew that a clean installation was the recommended way to upgrade to Jessie but I did not have physical access to the Pi to do this. I also really didn't want to start from scratch and re-configure everything to the way I wanted. So the only other option was to do the upgrade remotely over SSH, something I haven't done before. After doing some googling, the process appeared to be fairly straightforward so I decided to go ahead with it. In a tmux session I effectively did the following:

# Make sure system is already updated
sudo aptitude update
sudo aptitude safe-upgrade

# Modify sources
sudo sed -i /deb/s/wheezy/jessie/g /etc/apt/sources.list
sudo sed -i /deb/s/wheezy/jessie/g /etc/apt/sources.list.d/raspi.list

# Do the upgrade
sudo aptitude update
sudo aptitude full-upgrade


It it important to run the above in a screen or tmux session in case your internet connection breaks during the upgrade process. The upgrade process took a few hours during which time I was asked to upgrade or keep certain configuration files. The process was faily straightforward and I didn't encounter any issues which is a testament to the Debian team since they have made some major changes under the hood (most importanly being the shift to systemd). After doing a reboot following the upgrade everything appeared to be running as normal.

Removing GUI

I also wanted to remove the GUI on the Pi as I always access it via the command line over SSH. Doing the following got rid of all GUI and Xorg packages:

sudo aptitude purge ~ilibx11


Booting appears to be much quicker now thanks to systemd:

pi@raspberrypi:~$ systemd-analyze time
Startup finished in 11.819s (kernel) + 36.814s (userspace) = 48.634s