Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Ubuntu 10.10 which comes by default installed with Python 2.6, however some applications that I want to use require 2.7 and I want to update.

How would I go about doing this?

share|improve this question

It is already in the official repositories:

sudo apt-get install python2.7

You then execute python2.7

P.S. Support for ubuntu 10.10 ends in April 2012:

share|improve this answer
When I do this, the command python still uses 2.6, and using python2.7 would cause problems for me when installing modules. Is there a way to replace it over 2.6? – Alex Feb 10 '12 at 0:57
May I ask what kind of problems? :) You can link python to use python2.7, but I wouldn't suggest that, /usr/bin/python is used by most python packages in ubuntu and might cause problems if you attempt to change it. If you want to use python 2.7 for your program, use on top of the #!/usr/bin/python2.7 and chmod +x Then run it as ./ – medigeek Feb 10 '12 at 1:07
..or just upgrade your ubuntu. 11.04 has 2.7 as default: – medigeek Feb 10 '12 at 1:09
There is also a python-twitter package :) But you can always link the .py library files/folders in the according 2.7 directory, I think it's /usr/lib/python2.7/dist-packages/ – medigeek Feb 10 '12 at 1:16
Hm.. maybe you forget using python2.7 Also, if the package uses for installation, you can change the directory: sudo python2.7 install --libdir=/usr/lib/python2.7/dist-packages/ (or something like that, use --help if it doesn't work) – medigeek Feb 10 '12 at 1:30

The Deadsnakes PPA is helpful for old and new versions of Python.

Lucid through Precise is supported with versions 2.x and 3.x available. Since you are looking for 10.10, the direct link is:

share|improve this answer
  1. Update Ubuntu 10.10 sources (credit).

    Because 10.10 is no longer supported.

    sudo sed -i -e 's/\|' /etc/apt/sources.list
    sudo apt-get update
  2. Install add-apt-repository command (credit):

    This stops you from getting the sudo: add-apt-repository: command not found error in the next step.

    sudo apt-get install python-software-properties
  3. Install Deadsnakes PPA (credit):

    sudo add-apt-repository ppa:fkrull/deadsnakes
    sudo apt-get update
  4. Install Python 2.7:

    sudo apt-get install python2.7
  5. Profit!

    $ python2.7 --version
    Python 2.7.4

Edit: You can also install python 3.3 this way. Just replace step 4 with:

sudo apt-get install python3.3

Same goes for python 2.4, 2.5, 3.1, 3.2, etc.

share|improve this answer

Your Answer


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.