Datasheet

99
Chapter 4 Software Management
Each stanza of this file consists of several fields, each on their own line. (Within a
stanza, fields don’t need to be in any particular order, however.) The first field,
Explanation, can be used for comments, a short description of what you are trying
to do with the pin.
Package describes which packages are affected by this pin. The
special value
* means all packages, or you can give one or more package names
here. The next field contains the criterion you want to use to pick packages to pin. In
this case, the keyword
release in the first half of the line means you want to sort
packages based on the information in the
release file that should accompany each
package repository. (For more information on the subject, see Chapter 27.) The sec-
ond half of the line specifies which field of the release file is to be used;
a means
archive. Unfortunately,
apt doesn’t support release code names, so you have to use
the archive name (stable, testing, unstable) instead of sarge, etch, and sid. You can
also use
c for component (such as main, contrib, or nonfree), v for release version
(such as 3.0 for Debian’s woody release,)
o for origin, or l for label. Other keywords
you can use in the first half are
origin, which is confusingly not the same as the
origin field in the release file, but the Internet address of the package repository
(such as
ftp.debian.org), and version, which also is unconnected to the simi-
larly named field in the
release file and instead refers to a package version. This
will be explained in greater detail further on. The last field is the score you want
apt
to give to this pin. By default, an installed package gets a score of 100, and any other
sources get 500, unless a default release has been specified in
apts configuration, in
which case packages belonging to that release are assigned 990.
In the example preferences file, packages belonging to the stable release get the
highest priority. Testing, unstable, and experimental are both less than 100, so
assuming you have a package installed, you will not be prompted to upgrade it even
if a newer version is available than what is in stable. If you run
apt-cache policy
again, you can see the difference pinning makes:
$ apt-cache policy kword
kword:
Installed: 1:1.3.2-1.sarge.1
Candidate: 1:1.3.2-1.sarge.1
Version Table:
1:1.3.4-1 0
80 http://http.us.debian.org sid/main Packages
90 http://http.us.debian.org etch/main Packages
*** 1:1.3.2-1.sarge.1 0
100 /var/lib/dpkg/status
1:1.3.2-1.sarge.1 0
999 http://http.us.debian.org sarge/main Packages
Installing from multiple distributions
With pinning set up as shown previously, you are protected from accidental
upgrades to a different release. But what if you want to install a different version of
09_576445 ch04.qxd 7/5/05 3:10 PM Page 99