]>
Commit | Line | Data |
---|---|---|
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 |
35 | and the fragment files in the <filename>/etc/apt/preferences.d/</filename> |
36 | folder can be used to control which versions of packages will be selected | |
24f6490f | 37 | for installation.</para> |
ec2853a7 | 38 | |
24f6490f | 39 | <para>Several versions of a package may be available for installation when |
ec2853a7 | 40 | the &sources-list; file contains references to more than one distribution |
5b9d504e AL |
41 | (for example, <literal>stable</literal> and <literal>testing</literal>). |
42 | APT assigns a priority to each version that is available. | |
43 | Subject to dependency constraints, <command>apt-get</command> selects the | |
408a8e0a | 44 | version with the highest priority for installation. |
5b9d504e AL |
45 | The APT preferences file overrides the priorities that APT assigns to |
46 | package versions by default, thus giving the user control over which | |
24f6490f AL |
47 | one is selected for installation.</para> |
48 | ||
49 | <para>Several instances of the same version of a package may be available when | |
408a8e0a AL |
50 | the &sources-list; file contains references to more than one source. |
51 | In this case <command>apt-get</command> downloads the instance listed | |
5b9d504e | 52 | earliest in the &sources-list; file. |
408a8e0a | 53 | The APT preferences file does not affect the choice of instance, only |
24f6490f | 54 | the choice of version.</para> |
ec2853a7 | 55 | |
d9dedf30 DK |
56 | <para>Preferences are a strong power in the hands of a system administrator |
57 | but they can become also their biggest nightmare if used without care! | |
58 | APT will not questioning the preferences so wrong settings will therefore | |
59 | lead to uninstallable packages or wrong decisions while upgrading packages. | |
60 | Even more problems will arise if multiply distribution releases are mixed | |
61 | without a good understanding of the following paragraphs. | |
37049546 DK |
62 | Packages included in a specific release aren't tested in and |
63 | therefore doesn't always work as expected in older or newer releases or | |
64 | together with other packages from different releases. | |
d9dedf30 DK |
65 | You have been warned.</para> |
66 | ||
e29a6bb1 DK |
67 | <para>Note that the files in the <filename>/etc/apt/preferences.d</filename> |
68 | directory are parsed in alphanumeric ascending order and need to obey the | |
69 | following naming convention: The files have no or "<literal>pref</literal>" | |
70 | as filename extension and which only contain alphanumeric, hyphen (-), | |
71 | underscore (_) and period (.) characters - otherwise they will be silently | |
72 | ignored.</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 |
77 | that applies to a particular version then the priority assigned to that |
78 | version is the priority of the distribution to which that version | |
79 | belongs. It is possible to single out a distribution, "the target release", | |
80 | which receives a higher priority than other distributions do by default. | |
81 | The target release can be set on the <command>apt-get</command> command | |
82 | line or in the APT configuration file <filename>/etc/apt/apt.conf</filename>. | |
99fc3e08 LB |
83 | Note that this has precedence over any general priority you set in the |
84 | <filename>/etc/apt/preferences</filename> file described later, but not | |
85 | over specifically pinned packages. | |
408a8e0a | 86 | For example, |
24f6490f | 87 | |
408a8e0a AL |
88 | <programlisting> |
89 | <command>apt-get install -t testing <replaceable>some-package</replaceable></command> | |
90 | </programlisting> | |
91 | <programlisting> | |
92 | APT::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 | 97 | algorithm 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> | |
103 | files 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 | 124 | priority 100 to all installed package versions and priority 500 to all |
10df254b DK |
125 | uninstalled package versions, expect versions coming from archives which |
126 | in their <filename>Release</filename> files are marked as "NotAutomatic: yes" - | |
127 | these versions get the priority 1.</para> | |
ec2853a7 | 128 | |
24f6490f | 129 | <para>APT then applies the following rules, listed in order of precedence, |
5b9d504e | 130 | to determine which version of a package to install. |
ec2853a7 | 131 | <itemizedlist> |
5b9d504e AL |
132 | <listitem><simpara>Never downgrade unless the priority of an available |
133 | version exceeds 1000. ("Downgrading" is installing a less recent version | |
134 | of a package in place of a more recent version. Note that none of APT's | |
135 | default priorities exceeds 1000; such high priorities can only be set in | |
136 | the preferences file. Note also that downgrading a package | |
137 | can 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, | |
140 | install the most recent one (that is, the one with the higher version | |
141 | number).</simpara></listitem> | |
142 | <listitem><simpara>If two or more versions have the same priority and | |
143 | version 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 |
149 | is not as recent as one of the versions available from the sources listed in |
150 | the &sources-list; file (priority 500 or 990). Then the package will be upgraded | |
151 | when <command>apt-get install <replaceable>some-package</replaceable></command> | |
152 | or <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 |
156 | than any of the other available versions. The package will not be downgraded |
157 | when <command>apt-get install <replaceable>some-package</replaceable></command> | |
24f6490f | 158 | or <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 | 161 | version belonging to the target release, but not as recent as a version |
5b9d504e AL |
162 | belonging to some other distribution. Such a package will indeed be upgraded |
163 | when <command>apt-get install <replaceable>some-package</replaceable></command> | |
164 | or <command>apt-get upgrade</command> is executed, | |
24f6490f AL |
165 | because at least <emphasis>one</emphasis> of the available versions has a higher |
166 | priority 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 |
172 | assignment of priorities. The file consists of one or more multi-line records |
173 | separated by blank lines. Records can have one of two forms, a specific form | |
174 | and 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 |
178 | specified packages and specified version or version range. For example, | |
5b9d504e | 179 | the following record assigns a high priority to all versions of |
1c62ab24 MV |
180 | the <filename>perl</filename> package whose version number begins with "<literal>5.8</literal>". |
181 | Multiple packages can be separated by spaces.</simpara> | |
ec2853a7 AL |
182 | |
183 | <programlisting> | |
184 | Package: perl | |
185 | Pin: version 5.8* | |
186 | Pin-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 | 191 | given distribution (that is, to all the versions of packages that are |
24f6490f | 192 | listed in a certain <filename>Release</filename> file) or to all of the package |
5b9d504e | 193 | versions coming from a particular Internet site, as identified by the |
24f6490f | 194 | site's fully qualified domain name.</simpara> |
ec2853a7 | 195 | |
24f6490f | 196 | <simpara>This general-form entry in the APT preferences file applies only |
5b9d504e | 197 | to groups of packages. For example, the following record assigns a high |
24f6490f | 198 | priority to all package versions available from the local site.</simpara> |
ec2853a7 AL |
199 | |
200 | <programlisting> | |
201 | Package: * | |
202 | Pin: origin "" | |
203 | Pin-Priority: 999 | |
204 | </programlisting> | |
205 | ||
4fb6fdaf DK |
206 | <simpara>A note of caution: the keyword used here is "<literal>origin</literal>" |
207 | which can be used to match a hostname. The following record will assign a high priority | |
208 | to all versions available from the server identified by the hostname "ftp.de.debian.org"</simpara> | |
209 | <programlisting> | |
210 | Package: * | |
211 | Pin: origin "ftp.de.debian.org" | |
212 | Pin-Priority: 999 | |
213 | </programlisting> | |
214 | <simpara>This should <emphasis>not</emphasis> be confused with the Origin of a distribution as | |
24f6490f AL |
215 | specified in a <filename>Release</filename> file. What follows the "Origin:" tag |
216 | in a <filename>Release</filename> file is not an Internet address | |
217 | but 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 |
220 | belonging to any distribution whose Archive name is "<literal>unstable</literal>".</simpara> | |
ec2853a7 AL |
221 | |
222 | <programlisting> | |
223 | Package: * | |
224 | Pin: release a=unstable | |
704c39d6 | 225 | Pin-Priority: 50 |
ec2853a7 AL |
226 | </programlisting> |
227 | ||
efc487fb | 228 | <simpara>The following record assigns a high priority to all package versions |
e1dd65c9 | 229 | belonging to any distribution whose Codename is "<literal>&testing-codename;</literal>".</simpara> |
efc487fb DK |
230 | |
231 | <programlisting> | |
232 | Package: * | |
e1dd65c9 | 233 | Pin: release n=&testing-codename; |
efc487fb DK |
234 | Pin-Priority: 900 |
235 | </programlisting> | |
236 | ||
24f6490f AL |
237 | <simpara>The following record assigns a high priority to all package versions |
238 | belonging to any release whose Archive name is "<literal>stable</literal>" | |
239 | and whose release Version number is "<literal>3.0</literal>".</simpara> | |
ec2853a7 AL |
240 | |
241 | <programlisting> | |
242 | Package: * | |
0493db1e MZ |
243 | Pin: release a=stable, v=3.0 |
244 | Pin-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> |
256 | Priorities (P) assigned in the APT preferences file must be positive | |
ec2853a7 AL |
257 | or negative integers. They are interpreted as follows (roughly speaking): |
258 | ||
259 | <variablelist> | |
5b9d504e AL |
260 | <varlistentry> |
261 | <term>P > 1000</term> | |
262 | <listitem><simpara>causes a version to be installed even if this | |
263 | constitutes a downgrade of the package</simpara></listitem> | |
ec2853a7 | 264 | </varlistentry> |
5b9d504e AL |
265 | <varlistentry> |
266 | <term>990 < P <=1000</term> | |
267 | <listitem><simpara>causes a version to be installed | |
ec2853a7 | 268 | even if it does not come from the target release, |
5b9d504e | 269 | unless the installed version is more recent</simpara></listitem> |
ec2853a7 | 270 | </varlistentry> |
5b9d504e AL |
271 | <varlistentry> |
272 | <term>500 < P <=990</term> | |
273 | <listitem><simpara>causes a version to be installed | |
274 | unless there is a version available belonging to the target release | |
275 | or the installed version is more recent</simpara></listitem> | |
ec2853a7 | 276 | </varlistentry> |
5b9d504e AL |
277 | <varlistentry> |
278 | <term>100 < P <=500</term> | |
279 | <listitem><simpara>causes a version to be installed | |
280 | unless there is a version available belonging to some other | |
281 | distribution or the installed version is more recent</simpara></listitem> | |
24f6490f | 282 | </varlistentry> |
5b9d504e | 283 | <varlistentry> |
56298634 | 284 | <term>0 < P <=100</term> |
5b9d504e AL |
285 | <listitem><simpara>causes a version to be installed |
286 | only if there is no installed version of the package</simpara></listitem> | |
ec2853a7 | 287 | </varlistentry> |
5b9d504e AL |
288 | <varlistentry> |
289 | <term>P < 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 |
296 | first such record determines the priority of the package version. |
297 | Failing that, | |
298 | if any general-form records match an available package version then the | |
24f6490f | 299 | first 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 |
302 | records presented earlier:</para> | |
ec2853a7 AL |
303 | |
304 | <programlisting> | |
305 | Package: perl | |
306 | Pin: version 5.8* | |
b2e465d6 | 307 | Pin-Priority: 1001 |
ec2853a7 | 308 | |
b2e465d6 | 309 | Package: * |
ec2853a7 AL |
310 | Pin: origin "" |
311 | Pin-Priority: 999 | |
312 | ||
313 | Package: * | |
314 | Pin: release unstable | |
315 | Pin-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 | 321 | package will be installed, so long as that version's version number begins |
24f6490f AL |
322 | with "<literal>5.8</literal>". If <emphasis>any</emphasis> 5.8* version of <literal>perl</literal> is |
323 | available and the installed version is 5.9*, then <literal>perl</literal> will be | |
ec2853a7 | 324 | downgraded.</simpara></listitem> |
24f6490f | 325 | <listitem><simpara>A version of any package other than <literal>perl</literal> |
5b9d504e AL |
326 | that is available from the local system has priority over other versions, |
327 | even 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 |
330 | system but some other site listed in &sources-list; and which belongs to | |
24f6490f | 331 | an <literal>unstable</literal> distribution is only installed if it is selected |
5b9d504e | 332 | for 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 | 343 | to 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>: |
347 | for example, <filename>.../dists/stable/main/binary-i386/Packages</filename>. | |
348 | It consists of a series of multi-line records, one for each package available | |
349 | in that directory. Only two lines in each record are relevant for setting | |
350 | APT 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>: |
365 | for example, <filename>.../dists/stable/Release</filename>, | |
e1dd65c9 | 366 | or <filename>.../dists/&stable-codename;/Release</filename>. |
24f6490f | 367 | It consists of a single multi-line record which applies to <emphasis>all</emphasis> of |
5b9d504e | 368 | the 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 |
370 | file 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 | 376 | in the directory tree belong. For example, the line |
efc487fb DK |
377 | "Archive: stable" or |
378 | "Suite: stable" | |
5b9d504e | 379 | specifies that all of the packages in the directory |
24f6490f AL |
380 | tree 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 |
382 | would require the line: |
383 | </simpara> | |
ec2853a7 AL |
384 | <programlisting> |
385 | Pin: 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 | |
393 | in the directory tree belong. For example, the line | |
e1dd65c9 | 394 | "Codename: &testing-codename;" |
efc487fb DK |
395 | specifies that all of the packages in the directory |
396 | tree 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 |
398 | would require the line: |
399 | </simpara> | |
400 | <programlisting> | |
e1dd65c9 | 401 | Pin: 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 |
409 | packages in the tree might belong to Debian GNU/Linux release |
410 | version 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 |
412 | have not been released yet. Specifying this in the APT preferences |
413 | file would require one of the following lines. | |
ec2853a7 AL |
414 | </simpara> |
415 | ||
416 | <programlisting> | |
417 | Pin: release v=3.0 | |
f6271220 | 418 | Pin: release a=stable, v=3.0 |
ec2853a7 AL |
419 | Pin: 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 | 428 | packages in the directory tree of the <filename>Release</filename> file. |
5b9d504e | 429 | For example, the line "Component: main" specifies that |
24f6490f | 430 | all the packages in the directory tree are from the <literal>main</literal> |
5b9d504e AL |
431 | component, which entails that they are licensed under terms listed |
432 | in the Debian Free Software Guidelines. Specifying this component | |
433 | in the APT preferences file would require the line: | |
ec2853a7 | 434 | </simpara> |
ec2853a7 AL |
435 | <programlisting> |
436 | Pin: 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 |
444 | directory 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 |
446 | would require the line: |
447 | </simpara> | |
ec2853a7 AL |
448 | <programlisting> |
449 | Pin: 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 |
457 | of the <filename>Release</filename> file. Most commonly, this is |
458 | <literal>Debian</literal>. Specifying this label in the APT preferences file | |
ec2853a7 AL |
459 | would require the line: |
460 | </simpara> | |
ec2853a7 AL |
461 | <programlisting> |
462 | Pin: 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 | 470 | files retrieved from locations listed in the &sources-list; file are stored |
ec2853a7 | 471 | in the directory <filename>/var/lib/apt/lists</filename>, or in the file named |
24f6490f | 472 | by the variable <literal>Dir::State::Lists</literal> in the <filename>apt.conf</filename> file. |
ec2853a7 AL |
473 | For example, the file |
474 | <filename>debian.lcs.mit.edu_debian_dists_unstable_contrib_binary-i386_Release</filename> | |
475 | contains the <filename>Release</filename> file retrieved from the site | |
24f6490f AL |
476 | <literal>debian.lcs.mit.edu</literal> for <literal>binary-i386</literal> architecture |
477 | files from the <literal>contrib</literal> component of the <literal>unstable</literal> | |
478 | distribution.</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 |
485 | one or more lines beginning with the word <literal>Explanation:</literal>. | |
486 | This 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 | 496 | priority higher than the default (500) to all package versions belonging |
24f6490f AL |
497 | to a <literal>stable</literal> distribution and a prohibitively low priority to |
498 | package versions belonging to other <literal>Debian</literal> distributions. | |
ec2853a7 AL |
499 | |
500 | <programlisting> | |
5b9d504e AL |
501 | Explanation: Uninstall or do not install any Debian-originated |
502 | Explanation: package versions other than those in the stable distro | |
ec2853a7 AL |
503 | Package: * |
504 | Pin: release a=stable | |
505 | Pin-Priority: 900 | |
506 | ||
ec2853a7 AL |
507 | Package: * |
508 | Pin: release o=Debian | |
509 | Pin-Priority: -10 | |
510 | </programlisting> | |
511 | </para> | |
512 | ||
24f6490f | 513 | <para>With a suitable &sources-list; file and the above preferences file, |
ec2853a7 | 514 | any of the following commands will cause APT to upgrade to the |
24f6490f | 515 | latest <literal>stable</literal> version(s). |
ec2853a7 AL |
516 | |
517 | <programlisting> | |
518 | apt-get install <replaceable>package-name</replaceable> | |
519 | apt-get upgrade | |
520 | apt-get dist-upgrade | |
521 | </programlisting> | |
522 | </para> | |
523 | ||
24f6490f AL |
524 | <para>The following command will cause APT to upgrade the specified |
525 | package to the latest version from the <literal>testing</literal> distribution; | |
5b9d504e AL |
526 | the package will not be upgraded again unless this command is given |
527 | again. | |
ec2853a7 AL |
528 | |
529 | <programlisting> | |
530 | apt-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 |
539 | a high priority to package versions from the <literal>testing</literal> | |
5b9d504e | 540 | distribution, a lower priority to package versions from the |
24f6490f AL |
541 | <literal>unstable</literal> distribution, and a prohibitively low priority |
542 | to package versions from other <literal>Debian</literal> distributions. | |
ec2853a7 AL |
543 | |
544 | <programlisting> | |
545 | Package: * | |
546 | Pin: release a=testing | |
547 | Pin-Priority: 900 | |
548 | ||
549 | Package: * | |
550 | Pin: release a=unstable | |
551 | Pin-Priority: 800 | |
552 | ||
553 | Package: * | |
554 | Pin: release o=Debian | |
555 | Pin-Priority: -10 | |
556 | </programlisting> | |
557 | </para> | |
558 | ||
24f6490f | 559 | <para>With a suitable &sources-list; file and the above preferences file, |
5b9d504e | 560 | any of the following commands will cause APT to upgrade to the latest |
24f6490f | 561 | <literal>testing</literal> version(s). |
ec2853a7 AL |
562 | |
563 | <programlisting> | |
564 | apt-get install <replaceable>package-name</replaceable> | |
565 | apt-get upgrade | |
566 | apt-get dist-upgrade | |
567 | </programlisting> | |
568 | </para> | |
569 | ||
570 | <para>The following command will cause APT to upgrade the specified | |
24f6490f | 571 | package to the latest version from the <literal>unstable</literal> distribution. |
5b9d504e | 572 | Thereafter, <command>apt-get upgrade</command> will upgrade |
24f6490f | 573 | the package to the most recent <literal>testing</literal> version if that is |
5b9d504e | 574 | more 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 | 576 | version. |
ec2853a7 AL |
577 | |
578 | <programlisting> | |
579 | apt-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 | |
589 | priority higher than the default (500) to all package versions belonging | |
590 | to a specified codename of a distribution and a prohibitively low priority to | |
591 | package versions belonging to other <literal>Debian</literal> distributions, | |
592 | codenames and archives. | |
593 | Note that with this APT preference APT will follow the migration of a release | |
594 | from the archive <literal>testing</literal> to <literal>stable</literal> and | |
595 | later <literal>oldstable</literal>. If you want to follow for example the progress | |
596 | in <literal>testing</literal> notwithstanding the codename changes you should use | |
597 | the example configurations above. | |
598 | ||
599 | <programlisting> | |
600 | Explanation: Uninstall or do not install any Debian-originated package versions | |
e1dd65c9 | 601 | Explanation: other than those in the distribution codenamed with &testing-codename; or sid |
efc487fb | 602 | Package: * |
e1dd65c9 | 603 | Pin: release n=&testing-codename; |
efc487fb DK |
604 | Pin-Priority: 900 |
605 | ||
606 | Explanation: Debian unstable is always codenamed with sid | |
607 | Package: * | |
4a2bb9e6 | 608 | Pin: release n=sid |
efc487fb DK |
609 | Pin-Priority: 800 |
610 | ||
611 | Package: * | |
612 | Pin: release o=Debian | |
613 | Pin-Priority: -10 | |
614 | </programlisting> | |
615 | </para> | |
616 | ||
617 | <para>With a suitable &sources-list; file and the above preferences file, | |
618 | any of the following commands will cause APT to upgrade to the | |
e1dd65c9 | 619 | latest version(s) in the release codenamed with <literal>&testing-codename;</literal>. |
efc487fb DK |
620 | |
621 | <programlisting> | |
622 | apt-get install <replaceable>package-name</replaceable> | |
623 | apt-get upgrade | |
624 | apt-get dist-upgrade | |
625 | </programlisting> | |
626 | </para> | |
627 | ||
628 | <para>The following command will cause APT to upgrade the specified | |
629 | package to the latest version from the <literal>sid</literal> distribution. | |
630 | Thereafter, <command>apt-get upgrade</command> will upgrade | |
e1dd65c9 | 631 | the package to the most recent <literal>&testing-codename;</literal> version if that is |
efc487fb DK |
632 | more recent than the installed version, otherwise, to the most recent |
633 | <literal>sid</literal> version if that is more recent than the installed | |
634 | version. | |
ec2853a7 | 635 | |
efc487fb DK |
636 | <programlisting> |
637 | apt-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> |