I have two repositories with one package "libtidy-dev":
$ apt-cache policy libtidy-dev
libtidy-dev:
Installed: 20091223cvs-1.2ubuntu1.1
Candidate: 1:5.2.0-1+deb.sury.org~trusty+1
Фиксатор пакета: 1:5.2.0-1+deb.sury.org~trusty+1
Version table:
1:5.2.0-1+deb.sury.org~trusty+1 400
500 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main amd64 Packages
*** 20091223cvs-1.2ubuntu1.1 400
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
20091223cvs-1.2ubuntu1 400
500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
I want to set priority for package "libtidy-dev" of "ppa:ondrey/php" repository to 400. So I created /etc/apt/preferences.d/libtidy-dev.pref with this content:
Package: libtidy-dev
Pin: release o=LP-PPA-ondrej-php
Pin-Priority: 400
But it doesn't work. If i replace first row
Package: *
Pin: release o=LP-PPA-ondrej-php
Pin-Priority: 400
it will works but for all packages from this repo. I dont't need to reduce priority for all packages, I want to do this only for "libtidy-dev". So I tried another way. I wrote to pref file this:
Package: libtidy-dev
Pin: origin archive.ubuntu.com
Pin-Priority: 990
Package: libtidy-dev
Pin: origin security.ubuntu.com
Pin-Priority: 990
This config does the same thing. If first row has package name it not works, but if I specify asterisk instead of package name, it works but for all packaes of these repos. What I'm doing wrong? How to set priority for one package of one repository?
Based on the output of
apt-cache policy libtidy-dev
, your configuration for pinning the priority oflibtidy-dev
did apply:400
is listed next to the version number.For example, taking a Ubuntu 16.04 Xenial system with the default configuration and illustrating with
appstream
, as different versions of this package are available in thexenial
andxenial-backports
archives (which have different default priorities):Adding the following file:
Results in the output changing to:
You can also run
apt-cache policy
without specifying a package name, which will list any pinned packages at the end of output:The confusion stems from the fact that pinning all packages with a catch-all glob pattern changes the priority listed next to the archive, which is easier to spot than the one next to the package version: