Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

According to https://wiki.ubuntu.com/PrecisePangolin/ReleaseNotes/UbuntuDesktop "Python 2.6 is no longer available for install".

I need to support legacy software that runs only on Python 2.6. How can I install Python 2.6 on Ubuntu 12.04?

share|improve this question

8 Answers 8

up vote 64 down vote accepted

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

share|improve this answer
2  
I've added a PPA with rebuilds of just the Oneiric python2.6 on Precise, for anyone who doesn't want the rest of the PPA above: launchpad.net/~j5-dev/+archive/python2.6 –  David Fraser Jul 3 '12 at 2:55
    
j5-dev throws "Not Found", fkrull is very well supported –  chachan May 27 at 10:49

Try using the debs here (check the description dependencies as you may have a lot to download--but its all point/click debs).

Or if you got a usb with 10.04 install with software centre and make an aptoncd iso. You can open these and simply click the debs backed up within without doing a full auto install. I'm making a few to back-up the 10.04 debs as i fear they will be gone one day and 10.04 the best version in ubuntu history to date.

share|improve this answer

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.

share|improve this answer
    
pythonbrew now recommends to use pyenv –  Ovesh Oct 22 at 4:19

If you are upgrading to 12.04 and already have Python 2.6 installed, it will remain installed after your upgrade.

The packages installed will be considered "local", and obviously cannot be updated with the Upgrade Manager. Source-only security fixes (if any are needed) are available from python.org.

Only those 2.6 packages that are installed will remain, any that were not installed will not be accessible. If you need them, you can get them from the Ubuntu archives following Marius' instructions.

share|improve this answer
    
Unfortunately my upgrade did remove them :( –  David Fraser Jul 3 '12 at 2:40

for plone development on linux, we use this buildout script: https://svn.plone.org/svn/collective/buildout/bda-naked-python/

there are buildout configuration files for python versions 2.4, 2.5, 2.6, 2.7 and 3.2.

the README tells how to use it.

share|improve this answer

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.)

share|improve this answer
5  
For anyone wanting to download in one command (so you can replace the country and architecture in one go): wget http://XX.archive.ubuntu.com/ubuntu/pool/main/p/python2.6/{python2.6{,-minimal,-‌​dev,-dbg},libpython2.6}_2.6.7-4ubuntu1_i386.deb –  David Fraser Apr 30 '12 at 9:20
    
For me, it downloads i368 regardless of using amd64 in the URL... EDIT: Nevermind, silly mistake. –  Ken Apr 30 '12 at 16:43
1  
I've added a PPA with rebuilds of these on Precise: launchpad.net/~j5-dev/+archive/python2.6 –  David Fraser Jul 3 '12 at 2:54

Python isn't too hard to build. Try sudo apt-get install build-essential, sudo apt-get build-dep python2.7 (only gets dependencies which are almost the same as those for Python 2.6. Now download the Python 2.6 source distribution and ./configure, make, make install.

share|improve this answer
1  
But Ubuntu patches Python in various ways. I've seen reports where upstream Python 2.6 built on Ubuntu not sure which version (11.10 probably?) failed to link to libssl correctly, making certain standard library modules non-functional. –  Marius Gedminas Apr 26 '12 at 16:55
    
Attempting to build Python 2.6 in 12.04 results in myriad non-functional standard library packages. Without instructions on how to correct errors with building the zlib, sha, and other whack-a-mole problems, this answer is a waste of time. –  Nick T Mar 10 at 19:10

i dont know is it work or not, but you can try this:

apt-cache show python

this will show you version of the package and then try:

apt-get install packag_name=version

for getting only the available versions try this:

apt-cache policy <package_name>

make us know is it work or not...

share|improve this answer
1  
It will not work, since Python 2.6 is not in the standard repositories any more. –  Marius Gedminas Apr 26 '12 at 16:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.