Python – Install a Python2.5 on Ubuntu Lucid @ 1

A few months ago i was working on a Drupal CDN setup using the Drupal CDN module and File Conveyor written by Wim Leers. But i have some problems when running the File Conveyor. At first, i thought it is because Python version. Ubuntu 10.04 (Lucid) comes with Python 2.6 but i wanna run the File Conveyor in 2.5. (*Finally i found that the switching the Python version would not resolve the problem.)

There are 2 ways to install additional Python package.
By apt-get
1) Open the /etc/apt/source.list and add the following repository to at the end of the file.

 

2) Run apt-get update and if u met the following error

  • W: GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY E635A714505A2DD1
  • W: GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 1DABDBB4CEC06767
  • W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://download.virtualbox.org lucid Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 54422A4B98AB5139
  • W: GPG error: http://deb.opera.com stable Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY F9A2F76A9D1A0061

3. Add the key manually. For the first one E635A714505A2DD1, take the last 8 characters which is 505A2DD1 and run

  • gpg –keyserver keyserver.ubuntu.com –recv 505A2DD1
  • gpg –export –armor 505A2DD1 | sudo apt-key add –

 

4. If the key problem is resolved, then you can install the Python 2.5 package.

  • apt-get update
  • apt-get install python2.5 pythong2.5-minimal python2.5-dev

 

5. Add the package to update-alternatives for switching the version of Python.

  • update-alternatives –install /usr/bin/python python /usr/lib/python2.6 1
  • update-alternatives –install /usr/bin/python python /usr/lib/python2.5 10

 

6. When you want to switch, run

  • update-alternatives –config python

 

Please note that never try to remove the default Python 2.6 by apt-get remove!

Then 2nd approach is to install the extra Python package from source. I will talk about it later.

Done =)

Reference:

3 thoughts on “Python – Install a Python2.5 on Ubuntu Lucid @ 1”

Leave a reply to Tushar Kumar Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.