Ubuntu – How to fetch a specific package version from a repository

aptppa

Adding a PPA then running apt-get update to fetch seems to only fetch the latest version from that PPA, but I would like to install a specific version.

Eg: I'm adding the ondrej/php5-5.6 ppa. After an update, apt-cache policy php5 shows me that the available versions are:

  • 5.6.9+dfsg-1+deb.sury.org~trusty+2
  • 5.5.9+dfsg-1ubuntu4.9
  • 5.5.9+dfsg-1ubuntu4

A few days ago, the latest version from the PPA was 5.6.8+dfsg-1+deb.sury.org~trusty+4, but now it has updated. This means that I can't run an apt-get install and install the particular version I want.

Is this possible using apt?

Best Answer

It seems as though using apt-get install php5=5.6.* to match the version number solves the problem.

Looking on launchpad, version 4.6.8 no longer exists, only version 4.6.9 exists.

Similarly, the ppa:git-core/ppa PPA on launchpad only contains versions 2.4.2 and 2.3.7. It seems as though the latest patch release of each minor version is kept.

Using this meaning I can tie the install to a particular minor release, while still receiving patch updates.