Wednesday, July 21, 2010

Degrade PHP-5.3 to PHP-5.2 in Ubuntu

The mentioned script would degrade php-5.3 to php-5.2 in ubuntu.

#! /bin/sh
php_packages=`dpkg -l | grep php | awk '{print $2}'`

sudo apt-get remove $php_packages

sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list

sudo mkdir -p /etc/apt/preferences.d/

for package in $php_packages;
do echo "Package: $package
Pin: release a=karmic
Pin-Priority: 991
" | sudo tee -a /etc/apt/preferences.d/php

sudo apt-get update

sudo apt-get install $php_packages

No comments:

Post a Comment