Datasheet

97
Chapter 4 Software Management
Sometimes the default is not good enough. apts “pinning” feature lets you change
it. Here are a few scenarios where you might want to change the way
apt prioritizes
upgrades.
Using selected packages from another release
Sometimes you need a newer version of a package on your stable system, but you
don’t want to move entirely to testing or unstable. Debian also has an experimental
distribution for packages whose state is too raw even for unstable. You will want to
be very careful about installing and upgrading such packages, too careful to trust
the computer to do the right thing.
apt pinning will help in both these and other
situations.
/etc/apt/sources.list
Start by adding the apt sources for each release to /etc/apt/sources.list. A file
that includes stable, testing, unstable, and experimental will look something like this:
# Debian sarge (stable)
deb http://security.debian.org sarge/updates main contrib non-free
deb http://http.us.debian.org/debian/ sarge main contrib non-free
# Debian etch (testing)
deb http://http.us.debian.org/debian/ etch main contrib non-free
# Debian sid (unstable)
deb http://http.us.debian.org/debian/ sid main contrib non-free
# Debian experimental
deb http://http.us.debian.org/debian/ experimental main contrib non-free
After adding these lines, run
# apt-get update
so apt can add all the packages in these sources to its database. You can now
install packages from any of these distributions. But which will
apt-get pick?
apt-cache policy
The command
$ apt-cache policy <packagename>
will tell you what it is going to do. For instance, as I write this, I get the following
report for the KDE word processor
kword on a system running sarge with the same
sources.list as above:
$ apt-cache policy kword
kword:
Installed: 1:1.3.2-1.sarge.1
09_576445 ch04.qxd 7/5/05 3:10 PM Page 97