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. The package with newer version number 8.4.3 is ignored because its priority (500) is lower than the pin priority (991).
===== Package pinning =====
===== 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.
In specific cases it may be required to force a certain version or origin 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.
==== Pinning by Package Version ====
Example:
...
...
@@ -57,4 +59,16 @@ Pin: version 2:3.6.19-1~bpo70+1
Pin-Priority: 991
</code>
Use ''apt-cache policy <packagename>'' and ''apt-get upgrade'' to check that no updates would be installed for the requested packages.
\ No newline at end of file
Use ''apt-cache policy <packagename>'' and ''apt-get upgrade'' to check that no updates would be installed for the requested packages.
==== Pinning by Package Origin ====
Example:
<code>
Package: *
Pin: release o=CRAN
Pin-Priority: 499
</code>
Use ''apt-cache policy'' (without further parameter), ''apt-cache policy <packagename>'' and ''apt-get upgrade'' to check that no updates would be installed for the requested packages.