Skip to content
Snippets Groups Projects
Commit 64157c15 authored by Claude Becker's avatar Claude Becker
Browse files

notes_on_linux_package_management: apt-cache policy

parent 3f51f276
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,30 @@
* [[Debian Version Numbers]]
===== apt-cache policy =====
''apt-cache policy <packagename>'' provides information about the selection process of the package versions to be installed.
The output includes the version that is currently installed, the one of a possible update candidate and whether a package version is pinned. It displays a version table with the priorities of package sources as well as those of individual packages.
Example:
<code>
# apt-cache policy drbd8-utils
drbd8-utils:
Installed: 2:8.3.11-0ubuntu1
Candidate: 2:8.3.11-0ubuntu1
Package pin: 2:8.3.11-0ubuntu1
Version table:
2:8.4.3-0ubuntu0.12.04.1 991
500 http://ubuntu.ethz.ch/ubuntu/ precise-updates/main amd64 Packages
*** 2:8.3.11-0ubuntu1 991
500 http://ubuntu.ethz.ch/ubuntu/ precise/main amd64 Packages
100 /var/lib/dpkg/status
</code>
The priority in front of each package (500 or 100 in the example above) is the priority advertised by the package in that repository or location. The number at the end (namely 991) is the actual pin priority being placed on the package. This is like a critical threshold that has to be surpassed for a package to be considered a candidate for installation.
===== Package pinning =====
In specific cases it may be required to force a certain version of a package and prevent the installation of any upgrades. This can for instance be achieved through package pinning in //apt//. In practice this boils down to creating a config file in ''/etc/apt/preferences.d/'' with a regexp to match the package names, which version to pin and the priority.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment