I have an old server running Debian Squeeze. I'm trying to download the source of some package so that I can patch it manually. However, apt-get source fails for every package I try. An example:

root@xxxx:/home/myhomedir# apt-get source emacs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Ignore unavailable target release 'stable' of package 'emacs'
E: Unable to find a source package for 

The same error repeats for every other source package I try. Installing a package with the same name works, however (for example apt-get install emacs). Here are the contents of my sources.list:

# the basic archive
deb ftp://ftp.fi.debian.org/debian/ squeeze-lts main non-free contrib
deb-src ftp://ftp.fi.debian.org/debian/ squeeze-lts main non-free contrib

# the security patches
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free

I initially thought it was because of errors I got from apt-get update (see my previous question at apt-get update fails on debian squeeze with "File not found"), but this is now fixed and I still can't download sources.

  • This isn't a proper solution, but it would help point in the right direction: does apt-get source emacs23/squeeze-lts work? Could you edit your question to add the contents of /etc/apt/preferences? – Stephen Kitt Mar 7 '16 at 12:28
  • This does not work either. I don't have file /etc/apt/preferences. I have a folder named /etc/apt/preferences.d but it's empty. However, I have a file named apt-file.conf and folder apt.conf.d/ that has several files in it. apt.conf.d/70debconf has this line that might be relevant: APT::Default-Release "stable"; – Echows Mar 7 '16 at 12:36
  • Note: don't run apt-get source as root. It's not necessary, and doing things as root unnecessarily is a bad idea. – Faheem Mitha Mar 7 '16 at 13:56

The APT::Default-Release "stable"; line in your configuration is pinning you to stable which none of your deb or deb-src lines provide (stable is now jessie). To be able to use apt-get source without upgrading your whole distribution, you should either comment the line or change stable to squeeze-lts.

Note that you don't need to be root to run apt-get source, you can run it as a standard user.

Also, as garethTheRed points out, Squeeze is no longer supported (which, importantly, means that it no longer receives security updates). Not only that, but Squeeze LTS itself is no longer supported either, so you should really migrate to Wheezy LTS or Jessie sooner rather than later.

  • Thank you! This worked... sort of. I can now download the sources, but it seems that I can't build them. Some of the build dependencies (drac-dev for example) don't seem to exist at all in the repository, which is weird. – Echows Mar 7 '16 at 17:05
  • That's probably because Squeeze has been archived, so you need to point plain squeeze URIs in your apt configuration to archive.debian.org/debian/dists/squeeze (deb http://archive.debian.org/debian squeeze main non-free contrib). – Stephen Kitt Mar 7 '16 at 17:10

Debian Squeeze is end of life.

To continue to use unsupported packages you'll need to point apt-get to a different repository.

Edit /etc/apt/sources.list, comment out all the lines with a preceding # and add the following line:

deb http://archive.debian.org/debian/ squeeze contrib main non-free

This will allow you access to the last released version of Squeeze from the Debian archive site.

  • I tried this (and also added the same line with deb-src instead of deb). Still the same error. Also, the repositories I had before seem to still work. I can even go to the address of the repository in my browser and check that the packages indeed are still available. – Echows Mar 7 '16 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.