Posts Tagged "ubuntu"

Install Emacs on Ubuntu Lucid 10.04

Here is the single command to get you started with using emacs on Ubuntu. This will get you all the pretty syntax highlight for PHP, Python or even Ruby

sudo apt-get install emacs-snapshot emacs-goodies-el php-elisp ruby-elisp python-elisp

How to downgrade PHP to 5.2 on Ubuntu?

Here is a quick script to do this task:

Courtsey of Stijn Beauprez from here:

#! /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

To undo the script and upgrade to php 5.3 you will need to delete the file (sudo rm /etc/apt/preferences.d/php), run sudo apt-get update, and then sudo apt-get dist-upgrade which will get the latest packages for your distribution, including the PHP packages. (Ben Holt)