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