]> git.saurik.com Git - apt.git/blame - doc/apt_preferences.5.xml
merged from lp:~mvo/apt/mvo
[apt.git] / doc / apt_preferences.5.xml
CommitLineData
24f6490f
AL
1<?xml version="1.0" encoding="utf-8" standalone="no"?>
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
b2e465d6
AL
4
5<!ENTITY % aptent SYSTEM "apt.ent">
6%aptent;
7
8]>
9
10<refentry>
ec2853a7 11
5e80de29
AL
12 <refentryinfo>
13 &apt-author.team;
14 &apt-email;
15 &apt-product;
16 <!-- The last update date -->
d9dedf30 17 <date>16 February 2010</date>
5e80de29
AL
18 </refentryinfo>
19
b2e465d6 20 <refmeta>
24f6490f
AL
21 <refentrytitle>apt_preferences</refentrytitle>
22 <manvolnum>5</manvolnum>
f0599b9c 23 <refmiscinfo class="manual">APT</refmiscinfo>
b2e465d6 24 </refmeta>
ec2853a7 25
b2e465d6
AL
26 <!-- Man page title -->
27 <refnamediv>
24f6490f
AL
28 <refname>apt_preferences</refname>
29 <refpurpose>Preference control file for APT</refpurpose>
b2e465d6 30 </refnamediv>
b2e465d6 31
24f6490f
AL
32<refsect1>
33<title>Description</title>
34<para>The APT preferences file <filename>/etc/apt/preferences</filename>
daa4aa52
DK
35and the fragment files in the <filename>/etc/apt/preferences.d/</filename>
36folder can be used to control which versions of packages will be selected
24f6490f 37for installation.</para>
ec2853a7 38
24f6490f 39<para>Several versions of a package may be available for installation when
ec2853a7 40the &sources-list; file contains references to more than one distribution
5b9d504e
AL
41(for example, <literal>stable</literal> and <literal>testing</literal>).
42APT assigns a priority to each version that is available.
43Subject to dependency constraints, <command>apt-get</command> selects the
408a8e0a 44version with the highest priority for installation.
5b9d504e
AL
45The APT preferences file overrides the priorities that APT assigns to
46package versions by default, thus giving the user control over which
24f6490f
AL
47one is selected for installation.</para>
48
49<para>Several instances of the same version of a package may be available when
408a8e0a
AL
50the &sources-list; file contains references to more than one source.
51In this case <command>apt-get</command> downloads the instance listed
5b9d504e 52earliest in the &sources-list; file.
408a8e0a 53The APT preferences file does not affect the choice of instance, only
24f6490f 54the choice of version.</para>
ec2853a7 55
d9dedf30
DK
56<para>Preferences are a strong power in the hands of a system administrator
57but they can become also their biggest nightmare if used without care!
58APT will not questioning the preferences so wrong settings will therefore
59lead to uninstallable packages or wrong decisions while upgrading packages.
60Even more problems will arise if multiply distribution releases are mixed
61without a good understanding of the following paragraphs.
37049546
DK
62Packages included in a specific release aren't tested in and
63therefore doesn't always work as expected in older or newer releases or
64together with other packages from different releases.
d9dedf30
DK
65You have been warned.</para>
66
e29a6bb1
DK
67<para>Note that the files in the <filename>/etc/apt/preferences.d</filename>
68directory are parsed in alphanumeric ascending order and need to obey the
69following naming convention: The files have no or "<literal>pref</literal>"
70as filename extension and which only contain alphanumeric, hyphen (-),
71underscore (_) and period (.) characters - otherwise they will be silently
72ignored.</para>
73
24f6490f 74<refsect2><title>APT's Default Priority Assignments</title>
ec2853a7 75
24f6490f 76<para>If there is no preferences file or if there is no entry in the file
408a8e0a
AL
77that applies to a particular version then the priority assigned to that
78version is the priority of the distribution to which that version
79belongs. It is possible to single out a distribution, "the target release",
80which receives a higher priority than other distributions do by default.
81The target release can be set on the <command>apt-get</command> command
82line or in the APT configuration file <filename>/etc/apt/apt.conf</filename>.
99fc3e08
LB
83Note that this has precedence over any general priority you set in the
84<filename>/etc/apt/preferences</filename> file described later, but not
85over specifically pinned packages.
408a8e0a 86For example,
24f6490f 87
408a8e0a
AL
88<programlisting>
89<command>apt-get install -t testing <replaceable>some-package</replaceable></command>
90</programlisting>
91<programlisting>
92APT::Default-Release "stable";
93</programlisting>
ec2853a7
AL
94</para>
95
24f6490f 96<para>If the target release has been specified then APT uses the following
408a8e0a 97algorithm to set the priorities of the versions of a package. Assign:
24f6490f 98
ec2853a7 99<variablelist>
10df254b
DK
100<varlistentry>
101<term>priority 1</term>
102<listitem><simpara>to the versions coming from archives which in their <filename>Release</filename>
103files are marked as "NotAutomatic: yes" like the debian experimental archive.</simpara></listitem>
104</varlistentry>
105
ec2853a7
AL
106<varlistentry>
107<term>priority 100</term>
5b9d504e 108<listitem><simpara>to the version that is already installed (if any).</simpara></listitem>
ec2853a7 109</varlistentry>
24f6490f 110
ec2853a7
AL
111<varlistentry>
112<term>priority 500</term>
5b9d504e 113<listitem><simpara>to the versions that are not installed and do not belong to the target release.</simpara></listitem>
ec2853a7 114</varlistentry>
24f6490f 115
ec2853a7
AL
116<varlistentry>
117<term>priority 990</term>
5b9d504e 118<listitem><simpara>to the versions that are not installed and belong to the target release.</simpara></listitem>
ec2853a7
AL
119</varlistentry>
120</variablelist>
121</para>
122
24f6490f 123<para>If the target release has not been specified then APT simply assigns
5b9d504e 124priority 100 to all installed package versions and priority 500 to all
10df254b
DK
125uninstalled package versions, expect versions coming from archives which
126in their <filename>Release</filename> files are marked as "NotAutomatic: yes" -
127these versions get the priority 1.</para>
ec2853a7 128
24f6490f 129<para>APT then applies the following rules, listed in order of precedence,
5b9d504e 130to determine which version of a package to install.
ec2853a7 131<itemizedlist>
5b9d504e
AL
132<listitem><simpara>Never downgrade unless the priority of an available
133version exceeds 1000. ("Downgrading" is installing a less recent version
134of a package in place of a more recent version. Note that none of APT's
135default priorities exceeds 1000; such high priorities can only be set in
136the preferences file. Note also that downgrading a package
137can be risky.)</simpara></listitem>
138<listitem><simpara>Install the highest priority version.</simpara></listitem>
139<listitem><simpara>If two or more versions have the same priority,
140install the most recent one (that is, the one with the higher version
141number).</simpara></listitem>
142<listitem><simpara>If two or more versions have the same priority and
143version number but either the packages differ in some of their metadata or the
24f6490f 144<literal>--reinstall</literal> option is given, install the uninstalled one.</simpara></listitem>
ec2853a7
AL
145</itemizedlist>
146</para>
147
24f6490f 148<para>In a typical situation, the installed version of a package (priority 100)
5b9d504e
AL
149is not as recent as one of the versions available from the sources listed in
150the &sources-list; file (priority 500 or 990). Then the package will be upgraded
151when <command>apt-get install <replaceable>some-package</replaceable></command>
152or <command>apt-get upgrade</command> is executed.
ec2853a7
AL
153</para>
154
24f6490f 155<para>More rarely, the installed version of a package is <emphasis>more</emphasis> recent
5b9d504e
AL
156than any of the other available versions. The package will not be downgraded
157when <command>apt-get install <replaceable>some-package</replaceable></command>
24f6490f 158or <command>apt-get upgrade</command> is executed.</para>
ec2853a7 159
24f6490f 160<para>Sometimes the installed version of a package is more recent than the
ec2853a7 161version belonging to the target release, but not as recent as a version
5b9d504e
AL
162belonging to some other distribution. Such a package will indeed be upgraded
163when <command>apt-get install <replaceable>some-package</replaceable></command>
164or <command>apt-get upgrade</command> is executed,
24f6490f
AL
165because at least <emphasis>one</emphasis> of the available versions has a higher
166priority than the installed version.</para>
167</refsect2>
ec2853a7 168
24f6490f 169<refsect2><title>The Effect of APT Preferences</title>
ec2853a7 170
24f6490f 171<para>The APT preferences file allows the system administrator to control the
5b9d504e
AL
172assignment of priorities. The file consists of one or more multi-line records
173separated by blank lines. Records can have one of two forms, a specific form
174and a general form.
ec2853a7
AL
175<itemizedlist>
176<listitem>
1c62ab24
MV
177<simpara>The specific form assigns a priority (a "Pin-Priority") to one or more
178specified packages and specified version or version range. For example,
5b9d504e 179the following record assigns a high priority to all versions of
1c62ab24
MV
180the <filename>perl</filename> package whose version number begins with "<literal>5.8</literal>".
181Multiple packages can be separated by spaces.</simpara>
ec2853a7
AL
182
183<programlisting>
184Package: perl
185Pin: version 5.8*
186Pin-Priority: 1001
187</programlisting>
188</listitem>
189
24f6490f 190<listitem><simpara>The general form assigns a priority to all of the package versions in a
ec2853a7 191given distribution (that is, to all the versions of packages that are
24f6490f 192listed in a certain <filename>Release</filename> file) or to all of the package
5b9d504e 193versions coming from a particular Internet site, as identified by the
24f6490f 194site's fully qualified domain name.</simpara>
ec2853a7 195
24f6490f 196<simpara>This general-form entry in the APT preferences file applies only
5b9d504e 197to groups of packages. For example, the following record assigns a high
24f6490f 198priority to all package versions available from the local site.</simpara>
ec2853a7
AL
199
200<programlisting>
201Package: *
202Pin: origin ""
203Pin-Priority: 999
204</programlisting>
205
4fb6fdaf
DK
206<simpara>A note of caution: the keyword used here is "<literal>origin</literal>"
207which can be used to match a hostname. The following record will assign a high priority
208to all versions available from the server identified by the hostname "ftp.de.debian.org"</simpara>
209<programlisting>
210Package: *
211Pin: origin "ftp.de.debian.org"
212Pin-Priority: 999
213</programlisting>
214<simpara>This should <emphasis>not</emphasis> be confused with the Origin of a distribution as
24f6490f
AL
215specified in a <filename>Release</filename> file. What follows the "Origin:" tag
216in a <filename>Release</filename> file is not an Internet address
217but an author or vendor name, such as "Debian" or "Ximian".</simpara>
ec2853a7 218
24f6490f
AL
219<simpara>The following record assigns a low priority to all package versions
220belonging to any distribution whose Archive name is "<literal>unstable</literal>".</simpara>
ec2853a7
AL
221
222<programlisting>
223Package: *
224Pin: release a=unstable
704c39d6 225Pin-Priority: 50
ec2853a7
AL
226</programlisting>
227
efc487fb 228<simpara>The following record assigns a high priority to all package versions
e1dd65c9 229belonging to any distribution whose Codename is "<literal>&testing-codename;</literal>".</simpara>
efc487fb
DK
230
231<programlisting>
232Package: *
e1dd65c9 233Pin: release n=&testing-codename;
efc487fb
DK
234Pin-Priority: 900
235</programlisting>
236
24f6490f
AL
237<simpara>The following record assigns a high priority to all package versions
238belonging to any release whose Archive name is "<literal>stable</literal>"
239and whose release Version number is "<literal>3.0</literal>".</simpara>
ec2853a7
AL
240
241<programlisting>
242Package: *
0493db1e
MZ
243Pin: release a=stable, v=3.0
244Pin-Priority: 500
ec2853a7
AL
245</programlisting>
246</listitem>
247</itemizedlist>
248</para>
249
24f6490f 250</refsect2>
ec2853a7 251
24f6490f
AL
252<refsect2>
253<title>How APT Interprets Priorities</title>
ec2853a7 254
5b9d504e
AL
255<para>
256Priorities (P) assigned in the APT preferences file must be positive
ec2853a7
AL
257or negative integers. They are interpreted as follows (roughly speaking):
258
259<variablelist>
5b9d504e
AL
260<varlistentry>
261<term>P &gt; 1000</term>
262<listitem><simpara>causes a version to be installed even if this
263constitutes a downgrade of the package</simpara></listitem>
ec2853a7 264</varlistentry>
5b9d504e
AL
265<varlistentry>
266<term>990 &lt; P &lt;=1000</term>
267<listitem><simpara>causes a version to be installed
ec2853a7 268even if it does not come from the target release,
5b9d504e 269unless the installed version is more recent</simpara></listitem>
ec2853a7 270</varlistentry>
5b9d504e
AL
271<varlistentry>
272<term>500 &lt; P &lt;=990</term>
273<listitem><simpara>causes a version to be installed
274unless there is a version available belonging to the target release
275or the installed version is more recent</simpara></listitem>
ec2853a7 276</varlistentry>
5b9d504e
AL
277<varlistentry>
278<term>100 &lt; P &lt;=500</term>
279<listitem><simpara>causes a version to be installed
280unless there is a version available belonging to some other
281distribution or the installed version is more recent</simpara></listitem>
24f6490f 282</varlistentry>
5b9d504e 283<varlistentry>
56298634 284<term>0 &lt; P &lt;=100</term>
5b9d504e
AL
285<listitem><simpara>causes a version to be installed
286only if there is no installed version of the package</simpara></listitem>
ec2853a7 287</varlistentry>
5b9d504e
AL
288<varlistentry>
289<term>P &lt; 0</term>
290<listitem><simpara>prevents the version from being installed</simpara></listitem>
ec2853a7
AL
291</varlistentry>
292</variablelist>
293</para>
294
24f6490f 295<para>If any specific-form records match an available package version then the
5b9d504e
AL
296first such record determines the priority of the package version.
297Failing that,
298if any general-form records match an available package version then the
24f6490f 299first such record determines the priority of the package version.</para>
ec2853a7 300
24f6490f
AL
301<para>For example, suppose the APT preferences file contains the three
302records presented earlier:</para>
ec2853a7
AL
303
304<programlisting>
305Package: perl
306Pin: version 5.8*
b2e465d6 307Pin-Priority: 1001
ec2853a7 308
b2e465d6 309Package: *
ec2853a7
AL
310Pin: origin ""
311Pin-Priority: 999
312
313Package: *
314Pin: release unstable
315Pin-Priority: 50
316</programlisting>
317
24f6490f 318<para>Then:
ec2853a7 319<itemizedlist>
24f6490f 320<listitem><simpara>The most recent available version of the <literal>perl</literal>
ec2853a7 321package will be installed, so long as that version's version number begins
24f6490f
AL
322with "<literal>5.8</literal>". If <emphasis>any</emphasis> 5.8* version of <literal>perl</literal> is
323available and the installed version is 5.9*, then <literal>perl</literal> will be
ec2853a7 324downgraded.</simpara></listitem>
24f6490f 325<listitem><simpara>A version of any package other than <literal>perl</literal>
5b9d504e
AL
326that is available from the local system has priority over other versions,
327even versions belonging to the target release.
ec2853a7 328</simpara></listitem>
5b9d504e
AL
329<listitem><simpara>A version of a package whose origin is not the local
330system but some other site listed in &sources-list; and which belongs to
24f6490f 331an <literal>unstable</literal> distribution is only installed if it is selected
5b9d504e 332for installation and no version of the package is already installed.
ec2853a7
AL
333</simpara></listitem>
334</itemizedlist>
335</para>
24f6490f 336</refsect2>
ec2853a7 337
24f6490f
AL
338<refsect2>
339<title>Determination of Package Version and Distribution Properties</title>
ec2853a7 340
24f6490f 341<para>The locations listed in the &sources-list; file should provide
ec2853a7 342<filename>Packages</filename> and <filename>Release</filename> files
24f6490f 343to describe the packages available at that location. </para>
ec2853a7 344
24f6490f 345<para>The <filename>Packages</filename> file is normally found in the directory
ec2853a7
AL
346<filename>.../dists/<replaceable>dist-name</replaceable>/<replaceable>component</replaceable>/<replaceable>arch</replaceable></filename>:
347for example, <filename>.../dists/stable/main/binary-i386/Packages</filename>.
348It consists of a series of multi-line records, one for each package available
349in that directory. Only two lines in each record are relevant for setting
350APT priorities:
351<variablelist>
352<varlistentry>
24f6490f 353<term>the <literal>Package:</literal> line</term>
ec2853a7
AL
354<listitem><simpara>gives the package name</simpara></listitem>
355</varlistentry>
356<varlistentry>
24f6490f 357<term>the <literal>Version:</literal> line</term>
ec2853a7
AL
358<listitem><simpara>gives the version number for the named package</simpara></listitem>
359</varlistentry>
360</variablelist>
361</para>
362
24f6490f 363<para>The <filename>Release</filename> file is normally found in the directory
ec2853a7
AL
364<filename>.../dists/<replaceable>dist-name</replaceable></filename>:
365for example, <filename>.../dists/stable/Release</filename>,
e1dd65c9 366or <filename>.../dists/&stable-codename;/Release</filename>.
24f6490f 367It consists of a single multi-line record which applies to <emphasis>all</emphasis> of
5b9d504e 368the packages in the directory tree below its parent. Unlike the
24f6490f 369<filename>Packages</filename> file, nearly all of the lines in a <filename>Release</filename>
ec2853a7
AL
370file are relevant for setting APT priorities:
371
372<variablelist>
373<varlistentry>
efc487fb 374<term>the <literal>Archive:</literal> or <literal>Suite:</literal> line</term>
5b9d504e 375<listitem><simpara>names the archive to which all the packages
ec2853a7 376in the directory tree belong. For example, the line
efc487fb
DK
377"Archive: stable" or
378"Suite: stable"
5b9d504e 379specifies that all of the packages in the directory
24f6490f
AL
380tree below the parent of the <filename>Release</filename> file are in a
381<literal>stable</literal> archive. Specifying this value in the APT preferences file
ec2853a7
AL
382would require the line:
383</simpara>
ec2853a7
AL
384<programlisting>
385Pin: release a=stable
386</programlisting>
387</listitem>
388</varlistentry>
389
efc487fb
DK
390<varlistentry>
391<term>the <literal>Codename:</literal> line</term>
392<listitem><simpara>names the codename to which all the packages
393in the directory tree belong. For example, the line
e1dd65c9 394"Codename: &testing-codename;"
efc487fb
DK
395specifies that all of the packages in the directory
396tree below the parent of the <filename>Release</filename> file belong to a version named
e1dd65c9 397<literal>&testing-codename;</literal>. Specifying this value in the APT preferences file
efc487fb
DK
398would require the line:
399</simpara>
400<programlisting>
e1dd65c9 401Pin: release n=&testing-codename;
efc487fb
DK
402</programlisting>
403</listitem>
404</varlistentry>
405
ec2853a7 406<varlistentry>
24f6490f 407<term>the <literal>Version:</literal> line</term>
ec2853a7 408<listitem><simpara>names the release version. For example, the
5b9d504e
AL
409packages in the tree might belong to Debian GNU/Linux release
410version 3.0. Note that there is normally no version number for the
24f6490f 411<literal>testing</literal> and <literal>unstable</literal> distributions because they
5b9d504e
AL
412have not been released yet. Specifying this in the APT preferences
413file would require one of the following lines.
ec2853a7
AL
414</simpara>
415
416<programlisting>
417Pin: release v=3.0
f6271220 418Pin: release a=stable, v=3.0
ec2853a7
AL
419Pin: release 3.0
420</programlisting>
421
422</listitem>
423</varlistentry>
424
425<varlistentry>
24f6490f 426<term>the <literal>Component:</literal> line</term>
ec2853a7 427<listitem><simpara>names the licensing component associated with the
24f6490f 428packages in the directory tree of the <filename>Release</filename> file.
5b9d504e 429For example, the line "Component: main" specifies that
24f6490f 430all the packages in the directory tree are from the <literal>main</literal>
5b9d504e
AL
431component, which entails that they are licensed under terms listed
432in the Debian Free Software Guidelines. Specifying this component
433in the APT preferences file would require the line:
ec2853a7 434</simpara>
ec2853a7
AL
435<programlisting>
436Pin: release c=main
437</programlisting>
438</listitem>
439</varlistentry>
440
441<varlistentry>
24f6490f 442<term>the <literal>Origin:</literal> line</term>
5b9d504e 443<listitem><simpara>names the originator of the packages in the
24f6490f
AL
444directory tree of the <filename>Release</filename> file. Most commonly, this is
445<literal>Debian</literal>. Specifying this origin in the APT preferences file
ec2853a7
AL
446would require the line:
447</simpara>
ec2853a7
AL
448<programlisting>
449Pin: release o=Debian
450</programlisting>
451</listitem>
452</varlistentry>
453
454<varlistentry>
24f6490f 455<term>the <literal>Label:</literal> line</term>
5b9d504e 456<listitem><simpara>names the label of the packages in the directory tree
24f6490f
AL
457of the <filename>Release</filename> file. Most commonly, this is
458<literal>Debian</literal>. Specifying this label in the APT preferences file
ec2853a7
AL
459would require the line:
460</simpara>
ec2853a7
AL
461<programlisting>
462Pin: release l=Debian
463</programlisting>
464</listitem>
465</varlistentry>
466</variablelist>
467</para>
468
24f6490f 469<para>All of the <filename>Packages</filename> and <filename>Release</filename>
5b9d504e 470files retrieved from locations listed in the &sources-list; file are stored
ec2853a7 471in the directory <filename>/var/lib/apt/lists</filename>, or in the file named
24f6490f 472by the variable <literal>Dir::State::Lists</literal> in the <filename>apt.conf</filename> file.
ec2853a7
AL
473For example, the file
474<filename>debian.lcs.mit.edu_debian_dists_unstable_contrib_binary-i386_Release</filename>
475contains the <filename>Release</filename> file retrieved from the site
24f6490f
AL
476<literal>debian.lcs.mit.edu</literal> for <literal>binary-i386</literal> architecture
477files from the <literal>contrib</literal> component of the <literal>unstable</literal>
478distribution.</para>
479</refsect2>
ec2853a7 480
24f6490f
AL
481<refsect2>
482<title>Optional Lines in an APT Preferences Record</title>
ec2853a7 483
24f6490f
AL
484<para>Each record in the APT preferences file can optionally begin with
485one or more lines beginning with the word <literal>Explanation:</literal>.
486This provides a place for comments.</para>
24f6490f
AL
487</refsect2>
488</refsect1>
ec2853a7 489
24f6490f
AL
490<refsect1>
491<title>Examples</title>
492<refsect2>
493<title>Tracking Stable</title>
ec2853a7 494
24f6490f 495<para>The following APT preferences file will cause APT to assign a
ec2853a7 496priority higher than the default (500) to all package versions belonging
24f6490f
AL
497to a <literal>stable</literal> distribution and a prohibitively low priority to
498package versions belonging to other <literal>Debian</literal> distributions.
ec2853a7
AL
499
500<programlisting>
5b9d504e
AL
501Explanation: Uninstall or do not install any Debian-originated
502Explanation: package versions other than those in the stable distro
ec2853a7
AL
503Package: *
504Pin: release a=stable
505Pin-Priority: 900
506
ec2853a7
AL
507Package: *
508Pin: release o=Debian
509Pin-Priority: -10
510</programlisting>
511</para>
512
24f6490f 513<para>With a suitable &sources-list; file and the above preferences file,
ec2853a7 514any of the following commands will cause APT to upgrade to the
24f6490f 515latest <literal>stable</literal> version(s).
ec2853a7
AL
516
517<programlisting>
518apt-get install <replaceable>package-name</replaceable>
519apt-get upgrade
520apt-get dist-upgrade
521</programlisting>
522</para>
523
24f6490f
AL
524<para>The following command will cause APT to upgrade the specified
525package to the latest version from the <literal>testing</literal> distribution;
5b9d504e
AL
526the package will not be upgraded again unless this command is given
527again.
ec2853a7
AL
528
529<programlisting>
530apt-get install <replaceable>package</replaceable>/testing
531</programlisting>
24f6490f
AL
532</para>
533</refsect2>
ec2853a7 534
24f6490f
AL
535 <refsect2>
536 <title>Tracking Testing or Unstable</title>
ec2853a7 537
24f6490f
AL
538<para>The following APT preferences file will cause APT to assign
539a high priority to package versions from the <literal>testing</literal>
5b9d504e 540distribution, a lower priority to package versions from the
24f6490f
AL
541<literal>unstable</literal> distribution, and a prohibitively low priority
542to package versions from other <literal>Debian</literal> distributions.
ec2853a7
AL
543
544<programlisting>
545Package: *
546Pin: release a=testing
547Pin-Priority: 900
548
549Package: *
550Pin: release a=unstable
551Pin-Priority: 800
552
553Package: *
554Pin: release o=Debian
555Pin-Priority: -10
556</programlisting>
557</para>
558
24f6490f 559<para>With a suitable &sources-list; file and the above preferences file,
5b9d504e 560any of the following commands will cause APT to upgrade to the latest
24f6490f 561<literal>testing</literal> version(s).
ec2853a7
AL
562
563<programlisting>
564apt-get install <replaceable>package-name</replaceable>
565apt-get upgrade
566apt-get dist-upgrade
567</programlisting>
568</para>
569
570<para>The following command will cause APT to upgrade the specified
24f6490f 571package to the latest version from the <literal>unstable</literal> distribution.
5b9d504e 572Thereafter, <command>apt-get upgrade</command> will upgrade
24f6490f 573the package to the most recent <literal>testing</literal> version if that is
5b9d504e 574more recent than the installed version, otherwise, to the most recent
24f6490f 575<literal>unstable</literal> version if that is more recent than the installed
5b9d504e 576version.
ec2853a7
AL
577
578<programlisting>
579apt-get install <replaceable>package</replaceable>/unstable
580</programlisting>
581</para>
efc487fb
DK
582</refsect2>
583
584
585<refsect2>
586<title>Tracking the evolution of a codename release</title>
587
588<para>The following APT preferences file will cause APT to assign a
589priority higher than the default (500) to all package versions belonging
590to a specified codename of a distribution and a prohibitively low priority to
591package versions belonging to other <literal>Debian</literal> distributions,
592codenames and archives.
593Note that with this APT preference APT will follow the migration of a release
594from the archive <literal>testing</literal> to <literal>stable</literal> and
595later <literal>oldstable</literal>. If you want to follow for example the progress
596in <literal>testing</literal> notwithstanding the codename changes you should use
597the example configurations above.
598
599<programlisting>
600Explanation: Uninstall or do not install any Debian-originated package versions
e1dd65c9 601Explanation: other than those in the distribution codenamed with &testing-codename; or sid
efc487fb 602Package: *
e1dd65c9 603Pin: release n=&testing-codename;
efc487fb
DK
604Pin-Priority: 900
605
606Explanation: Debian unstable is always codenamed with sid
607Package: *
4a2bb9e6 608Pin: release n=sid
efc487fb
DK
609Pin-Priority: 800
610
611Package: *
612Pin: release o=Debian
613Pin-Priority: -10
614</programlisting>
615</para>
616
617<para>With a suitable &sources-list; file and the above preferences file,
618any of the following commands will cause APT to upgrade to the
e1dd65c9 619latest version(s) in the release codenamed with <literal>&testing-codename;</literal>.
efc487fb
DK
620
621<programlisting>
622apt-get install <replaceable>package-name</replaceable>
623apt-get upgrade
624apt-get dist-upgrade
625</programlisting>
626</para>
627
628<para>The following command will cause APT to upgrade the specified
629package to the latest version from the <literal>sid</literal> distribution.
630Thereafter, <command>apt-get upgrade</command> will upgrade
e1dd65c9 631the package to the most recent <literal>&testing-codename;</literal> version if that is
efc487fb
DK
632more recent than the installed version, otherwise, to the most recent
633<literal>sid</literal> version if that is more recent than the installed
634version.
ec2853a7 635
efc487fb
DK
636<programlisting>
637apt-get install <replaceable>package</replaceable>/sid
638</programlisting>
639</para>
24f6490f
AL
640</refsect2>
641</refsect1>
ec2853a7 642
daa4aa52
DK
643<refsect1>
644<title>Files</title>
645 <variablelist>
646 &file-preferences;
647 </variablelist>
648</refsect1>
649
24f6490f
AL
650<refsect1>
651<title>See Also</title>
5e80de29 652<para>&apt-get; &apt-cache; &apt-conf; &sources-list;
5b9d504e 653</para>
24f6490f 654</refsect1>
b2e465d6
AL
655
656 &manbugs;
ec2853a7 657
b2e465d6 658</refentry>