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