23 December 2016

Add jessie-backports repository for Rpi

The Raspberry Pi running Raspbian is as I write this on the Jessie release. This is what is known as a long-term release so while there will be some security and bug fixes no new versions of software are added. If you want to get later versions of software you can compile your own, use a testing/unstable release or add the jessie-backports repository.

Unfortunately the Raspberry Pi foundation don't have a jessie-backports repository. Debian however maintain one. Debian support the ARMv7 and later so this will work for the Raspberry Pi2 and Pi3. Don't use this on the Pi Zero, B+ or older (ARMv6) Raspberry Pi.

I use the command line for accessing my Pi's so these commands are done in a terminal window.

Add to sources.list
The first step is to add the jessie-backports to our sources.list file so that apt can include it. To do this we need to edit the file and add an extra entry. Type following commands:

cd /etc/apt
sudo nano sources.list

We need to add the following line after the Jessie entry
deb http://httpredir.debian.org/debian jessie-backports main contrib non-free

Save the file by doing Ctrl-O and when prompted for the filename press the Enter key. To exit do a Ctrl-X. That is hold the Control key down and press the letter.

The httpredir entry is a special entry that tells it to get the files from the fastest available Debian mirror. The jessie-backports part tells it which release.

Add gpg keys
Now we've added jessie-backports we need to get the latest list of program versions. Type the following command:

sudo apt-get update

This will give 2 error messages about missing gpg keys. We'll need to add them with the following commands. Check the keys given in the error message match the ones below and if not replace the key values with the ones from the error message.

gpg --keyserver pgpkeys.mit.edu --recv-key  8B48AD6246925553     
gpg -a --export 8B48AD6246925553 | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key  7638D0442B90D010     
gpg -a --export 7638D0442B90D010 | sudo apt-key add -

Don't forget the hyphen on the end of the apt-key add lines. Now lets try that again.

sudo apt-get update

Which should work this time and will check more repositories. I have received some errors where apt is unable to get the files but retrying the command a few minutes later works fine.

To tell apt we want a version from the jessie-backports repository we need to include -t jessie-backports to the install command, otherwise it simply picks the version from the jessie repository. For example:

sudo apt-get install –t jessie-backports boinc-client

This tells apt we want to install the boinc-client package from jessie-backports.

1 comment:

Brod said...

Good guide.
instead of sudo nano /etc/file use
sudo -e /etc/file
this has the benefit of running your preferred editor under your account and with your configuration.