#!/bin/sh # Script to install PHP 5.2 from 9.10 on 10.04 # And pin it so it does not get updated # Originally from http://2bits.com/drupal-planet/various-ways-running-php-52-ubuntu-1004-lucid-lynx.html # # Execute this script using root permission PKGS=`dpkg -l | grep php | awk '{print $2}'` apt-get remove $PKGS sed s/lucid/karmic/g /etc/apt/sources.list | tee /etc/apt/sources.list.d/karmic.list mkdir -p /etc/apt/preferences.d/ for PACKAGE in $PKGS do echo "Package: $PACKAGE Pin: release a=karmic Pin-Priority: 991 " | tee -a /etc/apt/preferences.d/php done apt-get update apt-get install $PKGS