Monthly Archives: January 2017

*Install old packages with Debian Snapshot *

:: snapshot.debian.org is a wayback machine that allows access to old packages based on dates and version numbers. It consists of all past and current packages the Debian archive provides. I found out about this service when a customer needed to use an older version of PHP, and I couldn't find a way to cleanly do this. Thanks to Debian Snapshot, it's now done & running.

I began by finding out the exact version of PHP and Apache packages that needs to be installed.

===
The client asked for PHP version 5.3, so I browsed to http://snapshot.debian.org/package/php5/

Found that the most up to date version is 5.3.10-2,
so I browsed to its folder : http://snapshot.debian.org/package/php5/5.3.10-2/

It shows date & time of 2012-02-21 04:16:01
so I added the following line to /etc/apt/sources.list :

—-
# PHP 5.3.10-2 packages
deb http://snapshot.debian.org/archive/debian/20120221T041601Z/ unstable main
—-

Note the date & time format on that line.

Now we need to install Apache version 2.22.2-1 – why this particular version?
Answer: because this is the version required by PHP 5.3.10-2 package; it will complain if any other version are installed. So yeah that's pretty easy to figure out 🙂

Using similar technique, I found out the line for Apache2 packages :

—-
# Apache 2.22.2-1 packages
deb http://snapshot.debian.org/archive/debian/20120202T040408Z/ unstable main
—-

Now let's do the installation process itself :

===========
# remove current PHP packages
sudo apt-get remove –purge `dpkg -l | grep php | grep -w 5.5 | awk '{print $2}' | xargs`
# remove current Apache packages
sudo apt-get remove –purge `dpkg -l | grep apache | grep -w 2 | awk '{print $2}' | xargs`

# update package database
apt-get update

# this is the setting required to be able to use Debian Snapshot
apt-get -o Acquire::Check-Valid-Until=false update

# now we can specify the exact version
apt-get install php5=5.3.10-2 libapache2-mod-php5=5.3.10-2 php5-cli=5.3.10-2 php5-common=5.3.10-2 php5-gd=5.3.10-2 php5-mcrypt=5.3.10-2 php5-mysql=5.3.10-2 php5-pgsql=5.3.10-2 apache2=2.2.22-1 apache2-mpm-prefork=2.2.22-1 apache2-suexec=2.2.22-1 apache2-utils=2.2.22-1 apache2.2-common=2.2.22-1 apache2.2-bin=2.2.22-1

/etc/init.d/apache2 restart
===========

If the commands does not work, maybe it's formatting problem – you can refer instead to my Pastebin here : http://pastebin.com/r2qBtbs4

Hope you find these useful (y)

Post imported by Google+Blog for WordPress.