You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

724 lines
27 KiB

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