Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apt-get : Identify all old version numbers of a package?

Tags:

php

debian

apt

I need to install PHP 5.3 on Debian. If I were to perform a regular install of PHP I would get version 5.4.

I understand that I can run apt-get install <package-name>=<package-version-number> to install a specific version. But I don't know what the exact package version number is for PHP 5.3.

I've ran apt-cache showpkg php5 and apt-cache madison php5 but they only list the current version.

How can I identify the correct version number to use to install PHP 5.3?

like image 377
Courtney Miles Avatar asked Jun 15 '13 22:06

Courtney Miles


1 Answers

I have no idea if it's available in some apt command, but you can get the full list here: http://snapshot.debian.org/package/php5/

It seems the latest PHP 5.3 for Debian is 5.3.10-2: http://snapshot.debian.org/package/php5/5.3.10-2/

To install a package from snapshot, you have to add an entry to your /etc/apt/sources.list matching the packages you want, this entry can be found in the "pool" link. For instance, for php5 5.3.10-2 the pool link is http://snapshot.debian.org/archive/debian/20120221T041601Z/pool/main/p/php5/ so you need to add http://snapshot.debian.org/archive/debian/20120221T041601Z/ to you sources.list:

deb http://snapshot.debian.org/archive/debian/20120221T041601Z/ unstable main
deb-src http://snapshot.debian.org/archive/debian/20120221T041601Z/ unstable main

Those entries needs to be set to unstable, that's because snapshots give you the first time the packages apparead in the debian packages, and most often that's in unstable (but I guess it could be on experimental as well).

Next you need to update while telling apt to ignore packages expiration date:

apt-get -o Acquire::Check-Valid-Until=false update

If you're using aptitude, that's:

aptitude -o Acquire::Check-Valid-Until=false update

Now you can install your specific version of php5:

apt-get install php5=5.3.10-2

Now, as you added an unstable repository to your installation, you may want to set priority to stable packages, see: http://www.imped.net/2007/07/20/apt-pinning-installing-unstable-packages-on-stable-debian/

like image 134
Guillaume Avatar answered Oct 16 '22 05:10

Guillaume