6

I was looking to install Python 3.6 on my Raspberry Pi (which is running Raspian jessie), and I followed the instructions in this post without reading the warning below. First of all, python3.6 didn't even install, and second of all, the apt-get install I tried doing afterwards failed. My understanding is that my installation is now at risk of being broken (i.e. becoming a FrankenDebian) due to mixing non-stable repositories.

How can I undo what I have done? The only commands of relevance that I've executed are

$ sudo nano /etc/apt/sources.list
# add
deb http://ftp.de.debian.org/debian testing main
$ echo 'APT::Default-Release "stable";' | sudo tee -a /etc/apt/apt.conf.d/00local
$ sudo apt-get update
$ sudo apt-get -t testing install python3.6
$ python3.6 -V

When I try to apt-get install anything, I get the error:

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

1 Answer 1

5

The message you’re getting,

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

isn’t directly related to the addition of testing; it’s caused by the APT::Default-Release "stable" setting (I’m guessing your sources.list references “jessie” rather than “stable”). To fix that, remove the corresponding line from /etc/apt/apt.conf.d/00local.

To undo the other operations, and return to a non-FrankenDebian using Jessie only:

  • remove the testing line from /etc/apt/sources.list
  • update the indexes:

    sudo apt update
    
  • downgrade any package which was upgraded back to the version in Debian 9:

    sudo apt install $(printf "%s/stable " $(apt list --installed | grep -v /stable | cut -d/ -f1))
    

The latter command will list all installed packages, find any which are not installed in a version available in Raspbian Jessie (by excluding anything listed as /stable), extract the package names, reformat them with /stable appended, and instruct apt to install them, which will re-install the packages in their Raspbian Jessie version.

2
  • The error was E: The value 'stable' is invalid for APT::Default-Release as such a release is not available in the sources. I'll try your answer and report back.
    – actinidia
    Commented May 17, 2018 at 22:36
  • The third command you suggested yielded the same error above.
    – actinidia
    Commented May 17, 2018 at 22:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .