Alex Rivera | Logout

On Ubuntu, how do you install a newer version of python and keep the older python version?

Asked 2010-06-16T03:18:12.867
9

Background:

  • I am using Ubuntu
  • The newer python version is not in the apt-get repository (or synaptic)
  • I plan on keeping the old version as the default python when you call "python" from the command line
  • I plan on calling the new python using pythonX.X (X.X is the new version).

Given the background, how do you install a newer version of python and keep the older python version?


I have downloaded from python.org the "install from source" *.tgz package. The readme is pretty simple and says "execute three commands: ./configure; make; make test; sudo make install;"

If I do the above commands, will the installation overwrite the old version of python I have (I definitely need the old version)?

Edit
Report

1 Answer

1

Just installed Python2.6 on Ubuntu 8.04.
first get all the required dependencies "apt-get build-dep python2.5" (The python 2.6 dependencies are the same as for 2.5)
apply the patch from http://www.lysium.de/sw/python2.6-disable-old-modules.patch:
patch -p1 < python2.6-disable-old-modules.patch

then ./configure --prefix=/opt/python2.6
make
sudo make install

sudo ln -s /opt/python2.6/bin/python2.6 /usr/local/bin/python2.6
it seems just works, default Python version is still 2.5. I save it at here, hope this helps.

answered 2010-06-16T04:44:29.120

Your Answer