3

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?

5
  • 1
    Which PPA are you using?
    – Wilf
    Jun 2, 2015 at 20:04
  • For clarity, I'm looking to be able to fetch particular versions from PPA's in general, not trying to avoid new releases of PHP. This just happens to be the example in front of me
    – dannyw88
    Jun 2, 2015 at 20:07
  • @Wilf I'm adding ppa:ondrej/php5-5.6, using add-apt-repository
    – dannyw88
    Jun 2, 2015 at 20:14
  • 1
    Use launchpad to find the actually find the package. The note the name and use that to download via terminal
    – Virusboy
    Jun 2, 2015 at 20:33
  • @Virusboy, thanks for the tip - I investigated and think I found the solution I was after
    – dannyw88
    Jun 2, 2015 at 20:54

4 Answers 4

3

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.

1
  • This 'solves the problem' only in such that the repository has to have that version. If you have multiple PPAs that's one thing, but if the version available in the repos is higher than you have downloaded/cached on your system, it's not going to work. (There are no transactional updates in apt repos)
    – Thomas Ward
    Jun 4, 2015 at 14:47
2

You can only install the latest version from a PPA, as old versions are deleted when new versions of a package are built and published in a PPA.

1

@Dobey answer seems to be the best solution in your situation. Though if you installed a package from a specific PPA what you can do is to mark that package when it's installed so to keep that version. For example run:

sudo apt-mark hold packagename
1

You can sometimes get old versions, depending on the source. For the most part, when a package is updated, it replaces the previous updated version (some repos keep the first version for that release, until the release goes End Of Life). This also depends on whether newer versions include security updates, or are no longer supported 'upstream' (where the package came from).

If the version you want to install is still in the repository, you can use this syntax to install the package:

sudo apt-get install apache2=2.2.20-1ubuntu1

If is not available from the repo you are using, you may be able to get the package from elsewhere.

With the PPA you seem to be using, you can currently get version 5.6.9. But there is another PPA by the author, from which you can get version 5.5.25. (There is also this one with 5.4.41, but only really for 12.04)

There are also third-party sites that often have old (and sometimes newer) versions. For Ubuntu, Ubuntu Updates (there other sites as well - e.g. for Fedora etc there is rpmfind (yes, RPMs.... - you can use alien (see below), or get the src.rpm and use the stuff in that to build something usable in non-RPM systems :D).

If all else fails, you can get try to a get a source version of the version you want (for PHP, see here), and then make the packages from that. This you can build and install directly, or build deb package(s) out of it and install those.

You can also use alien to install packages not in the deb format (this seems to include tar.gz).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .