Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On a computer running "stable" Debian, when trying to install a package which is in the unstable list on the Debian web site using the aptitude install <package>/unstable command, I get output similar to this:

Couldn't find any package whose name or description matched "<package>"
Couldn't find any package whose name or description matched "<package>"
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

What can I do to be able to install "unstable" packages? (I thought of adding the repository to sources.list, but I don't want everything to start being installed from "unstable").

So: how can I install unstable packages (with using /stable at the end of the package name)?

share|improve this question
    
See unix.stackexchange.com/q/112157/4671 for an in-depth answer to this question. –  Faheem Mitha Apr 11 at 1:39

1 Answer 1

up vote 19 down vote accepted

You do need to have unstable listed in your sources.list. Otherwise apt just won't find the package.

To avoid unstable packages being pulled in, you have two ways.

  • The easy way is to add a Default-Release clause to /etc/apt/apt.conf (or to a file /etc/apt/apt.conf.d/my-default-release).

    APT::Default-Release "stable";
    
  • The hard way is to use APT preferences. In /etc/apt/preferences:

    Package: *
    Pin: release o=Debian,a=unstable
    Pin-Priority: 10
    

Note that for most of the lifetime of a Debian release, it's not practical to install most packages from unstable on a stable system, because they'll pull in a lot of libraries from unstable, and you'll end up with an unstable system. First look if there is a backport for them. Otherwise, if you want to install a package from unstable but not have to pull in its dependencies, try getting the source from unstable and recompiling.

apt-get source foo=1.42
apt-get build-dep foo  # pulls the dependencies of foo in stable but that's often good enough
dpkg-source -x foo_1.42.dsc
cd foo-1.42
dpkg-buildpackage -rfakeroot -us -uc -b -nc
dpkg -i ../foo_1.42_$(arch).deb
share|improve this answer
    
The apt.conf files seems to no longer exist in Debian testing (wiki.debian.org/AptConf), its role apparently having been assumed by /etc/apt/apt.conf.d/70debconf. If this is correct, perhaps the answer should be amended to indicate this release-dependence? –  user001 Aug 28 at 20:17
1  
@user001 /etc/apt/apt.conf is no longer created by default, but it's still read. You can put local additions either in that file or in a file under /etc/apt/apt.conf.d (don't add to a distribution-provided file in /etc/apt/apt.conf.d). –  Gilles Aug 28 at 20:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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