How can I install Python 2.6 on 12.04?

I'm using a PPA: https://launchpad.net/~fkrull/+archive/deadsnakes

Install the PPA:

sudo add-apt-repository ppa:fkrull/deadsnakes

Run Update:

sudo apt-get update

Install your flavor:

sudo apt-get install python2.6 python2.6-dev


Check out pythonbrew. It does a great job of managing multiple python versions and enviroments. It builds each version of python from source, but does so in a user friendly way. After you install it just run:

pythonbrew install 2.6
pythonbrew switch 2.6

Then you can use it with virtualenv to create a virtual enviroment with whatever frameworks and libraries you need without having to worry about conflicts.


I looked for a PPA, didn't find any, then installed Python 2.6 packages from 11.10 by hand:

cd /tmp
wget http://XX.archive.ubuntu.com/ubuntu/pool/main/p/python2.6/python2.6_2.6.7-4ubuntu1_i386.deb
wget http://XX.archive.ubuntu.com/ubuntu/pool/main/p/python2.6/python2.6-minimal_2.6.7-4ubuntu1_i386.deb
wget http://XX.archive.ubuntu.com/ubuntu/pool/main/p/python2.6/python2.6-dev_2.6.7-4ubuntu1_i386.deb
wget http://XX.archive.ubuntu.com/ubuntu/pool/main/p/python2.6/python2.6-dbg_2.6.7-4ubuntu1_i386.deb
wget http://XX.archive.ubuntu.com/ubuntu/pool/main/p/python2.6/libpython2.6_2.6.7-4ubuntu1_i386.deb
dpkg -i *python2.6*_2.6.7-4ubuntu1_i386.deb

Replace XX with your country code, and, if necessary, i386 with your architecture (amd64 for 64-bit installs).

(Also, most people don't need the -dbg package.)

Tags:

Python