Because this matter was mentioned in the 26 November Debian
Weekly News, it seems appropriate to post an update.
Susan Kleinmann took the bull by the horns and rewrote
the page from scratch. I have proposed some revisions
and hopefully we'll have a finished product soon. I
append the latest version I have, in the hopes that
people will point out any remaining errors.
--
Thomas Hood
APT_PREFERENCES(5) APT_PREFERENCES(5)
NAME
apt_preferences - Preference control file for APT
DESCRIPTION
The APT preferences file /etc/apt/preferences can be used
to control which version of a package will be selected for
installation.
Several versions of a package may be available for instal
lation when the sources.list(5) file contains references
to more than one release (for example, stable and test
ing), and several instances of the same version of a pack
age may be available when the file contains references to
more than one download site for a particular release. APT
assigns a "priority" to each instance that is available.
(In what follows, an "instance" will be an instance of a
package that is available according to sources.list(5).)
Subject to dependency constraints, apt-get installs the
instance with the highest priority.
The APT preferences file overrides the priorities that APT
assigns to package instances by default, thus giving the
user control over which one is selected.
APT'S DEFAULT PRIORITY ASSIGNMENTS
If there is no preferences file, or if there is no entry
in the file that applies to a particular instance, then
the priority assigned to an instance is the priority
assigned to the release to which that instance belongs.
It is possible to single out a release, called the "target
release", which receives a higher priority than other
releases. The target release can be set on the apt-get
command line or in the APT configuration file
/etc/apt/apt.conf. For example,
# Command to install the version of some-pkg from the testing
release
apt-get install -t testing some-pkg
# Configuration setting to make stable the target release
APT::Default-Release "stable";
If a target release has been specified, then APT uses the
following algorithm to set the priorities of the instances
of a package. Assign:
priority 100
to the instance of a package that is already
installed (if any).
priority 500
to the instances of a package that are not
installed and do not belong to the target release.
priority 990
to the instances of a package that are not
installed and belong to the target release.
If no target release has been specified, then APT simply
assigns priority 100 to all installed package instances
and priority 500 to all uninstalled package instances.
APT then applies the following rules to determine which
instance of a package to install:
· Never downgrade an installed package unless the priority
of an available instance of the package exceeds 1000.
(Note that none of APT's default priorities exceeds this
threshold; such high priorities can only be set in the
preferences file.)
· Always install or upgrade to the highest priority
instance of a package.
· If two or more instances of a package have the same pri
ority, install or upgrade to the most recent one.
In a typical situation, the installed instance of a pack
age (priority 100) is not as recent as one of the
instances available from the sites and releases listed in
the sources.list(5) file (priority 500 or 990). Then the
package will be upgraded with the command: apt-get install
or apt-get dist-upgrade.
Rarely, the installed instance of a package is more recent
than any of the other available instances. This package
will not be downgraded.
Sometimes the installed instance of a package is more
recent than the version belonging to the target release,
but not as recent as a version belonging to some other
release. Such a package will indeed be upgraded, because
at least one of the available instances has a higher pri
ority than the installed instance.
THE EFFECT OF APT PREFERENCES
The APT preferences file allows the system administrator
to customize priorities. The preferences file consists of
one or more multi-line records separated by blank lines.
Records can have one of two forms:
· The fir