User Tools

Site Tools


ubuntu:packages:package_priorities

Ubuntu - Packages - Package Priorities

APT supports setting priorities associated with each package source.

It is possible to assign a priority to each available package (the same package can have several priorities depending on its version or the distribution providing it).

These priorities will influence APT's behavior: for each package, it will always select the version with the highest priority (except if this version is older than the installed one and if its priority is less than 1000).

Different priorities can also be used to extend one distribution with one or two newer packages from Testing, Unstable or Experimental.


Priority Settings

Priority ValuesAction
<0Package will never be installed
0-100Package will only be installed if no other version of the package is already installed
100-500Package will only be installed if there is no other newer version installed or available in another distribution
501-990Package will only be installed if there is no newer version installed or available in the target distribution
990-1000Package will be installed except if the installed version is newer
>1000Package will always be installed even if it forces APT to downgrade to an older version

Changing Package Priority

Edit the /etc/apt/preferences file.

/etc/apt/preferences
Package: *
Pin: release a=stable
Pin-Priority: 900
 
Package: *
Pin: release o=Debian
Pin-Priority: -10
  • a=stable defines the name of the selected distribution.
  • o=Debian limits the scope to packages whose origin is “Debian”.

Force no upgrades of a package

Assume that you have a server with several local programs depending on the version 5.14 of Perl and that you want to ensure that upgrades will not install another version of it. You could use this entry:

/etc/apt/preferences
Package: perl
Pin: version 5.14*
Pin-Priority: 1001
ubuntu/packages/package_priorities.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki