Ubuntu – Is it possible to only allow specific packages updates from a PPA

ppa

Let us say I have added a PPA that has X package that I want but it also has Y package that I do not want to use or receive updates from. How can I, from the same PPA, receive updates for a specific package but deny updates from the same PPA for other packages.

A step by step example would be good since this has happened to me in several PPAs that have a particular package I want but also add a whole bunch of others that I do not yet want to update.

Best Answer

You would use what is called "pinning"

Assuming you are installing package foo from the PPA, you would almost certainly need to install any dependencies from the ppa as well.

But if there are other programs, you can specify which repository to use with pinning.

See Ubuntu wiki pinning

There is an example of pinning a ppa on that page

https://help.ubuntu.com/community/PinningHowto#Pinning_the_ubuntu-mozilla-daily_PPA

From the wiki page:

To make apt-get upgrading as painless as possible set a lower Pin-Priority on the PPA, this will stop unwanted package versions from installing. Once set, packages from the ubuntu-mozilla-daily PPA will always lose in any contest with packages from other repositories, even if they have a higher version.

Create the file /etc/apt/preferences.d/ubuntu-mozilla-daily-pin-400

Add the following to the file:

Package: *
Pin: release o=LP-PPA-ubuntu-mozilla-daily
Pin-Priority: 400

Use the following commands, before and after, to check that the Pin-Priority has been updated.

apt-cache policy

apt-cache policy firefox-3.5