Anargy

Anargy PPA - Pinning

If you only want one or a few packages from our PPA, but not all, use Pinning to do this.

Pinning is the mechanism to tell your Ubuntu to give packages a higher or lower priority. The default priority for packages is 500.

Create a file in the directory /etc/apt/preferences.d/ with two clauses. The first one says give all the packages in the Anargy PPA a lower priority than the regular one (so that they are not preferred even if they have a higher version number). The second clause partly overrides the first by saying give the package in that ppa with the name "nginx" the same priority as other packages so that it will get installed (by it having a higher version number).

$ cat /etc/apt/preferences.d/pin-anargy

# Never prefer other packages from Anargy PPA
Package: *
Pin: release o=LP-PPA-anargy-jammy
Pin-Priority: -1

# Allow upgrading Nginx from Anargy PPA
Package: nginx
Pin: release o=LP-PPA-anargy-jammy
Pin-Priority: 500

It may seem complicated, but is actually pretty straight forward. To get the required string for the "Pin: release" option we use the command apt-cache policy.

$ apt-cache policy
...
 500 https://ppa.launchpadcontent.net/anargy/jammy/ubuntu jammy/main amd64 Packages
     release v=22.04,o=LP-PPA-anargy-jammy,a=jammy,n=jammy,l=Ubuntu 22.04,c=main,b=amd64
     origin ppa.launchpadcontent.net
...
Pinned packages:
     nginx -> 1.25.2-1~anargy+jammy with priority 500

About the number of Pin Priority

Copyright © 2025   Anargy B.V.