5

I have installed Linux raspberrypi 4.4.11-v7+ #888 SMP Mon May 23 20:10:33 BST 2016 armv7l GNU/Linux on my Raspberry Pi 3 using SD card.

When I try to install packages I am getting error:

E: The value '\stable' is invalid for APT::Default-Release as such a release is not available in the sources

How do I resolve this error?

techraf
  • 4,353
  • 10
  • 32
  • 43
user1811790
  • 53
  • 2
  • 7

2 Answers2

4

Background

I got a very similar error when using an SD card image of basically unknown origins and trying to upgrade my packages. It turns out there's a config file that says \stable and it needs to match the name of the Raspbian release instead.

It looks like my image, as well as your image, was using the "stable" branch at the time it was made. You can read more about the Debian branches (Raspbian is a derivative of Debian) here.

You'll need to find which branch you're using, which I found out how to do here, using the command cat /etc/os-release. For example, it will say something like this:

$ 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"

I found several articles and Q&A sites with a similar error, but I had to do my own poking around to find the file to edit (SuperUser, LinuxQuestions.org, AskUbuntu). Funnily enough, I found the answer while typing up this answer.

How to fix the problem

Edit this file:

sudo nano /etc/apt/apt.conf.d/10defaultRelease

There will be a single line in that file, and change it from

APT::Default-release \"stable";

to

APT::Default-release \"jessie";

And then save and exit. You will now be able to use sudo apt-get upgrade, and presumably any other apt function. I was able to do the upgrade, and then install packages after doing this.

YetAnotherRandomUser
  • 1,120
  • 2
  • 11
  • 34
-4

Check your internet connection.