Super User is a question and answer site for computer enthusiasts and power users. 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

My project needs to stay current on Python releases, but 12.04LTS is currently stuck on 2.7.3, even though 2.7.5 is out now. Is there a way I can stay more current without manually compiling? We're required to stay on package-based installation for Python. What's the "right" way to handle this?


share|improve this question
up vote 9 down vote accepted

EDIT: *As @Anthon has pointed out in the comments, this PPA does not include Python 2.7 for Ubuntu 12.04 (Precise). See funky-future's answer below, which I don't believe existed when I originally responded.

The preferred "Ubuntu" way to deal with packages not included in their universe by default is to use a PPA (third part repository), rather than manually compiling. You maintain the benefits of package management, updates, and dependency resolution this way.

However, the third party repositories are NOT officially supported, if that is part of your requirement.

The DeadSnakes (get it) PPA maintains Python releases not included in the systems package management.

sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.7

You can read more about this PPA here.

However, in your case this does not include Python 2.7, as DeadSnakes only provides major versions not included and not point releases. As Ubuntu already packages 2.7 for Ubuntu 12.04, DeadSnakes will not provide this.

It might be preferable for you to make the case that you should not use the native packaging with Ubuntu in this case. See this excerpt from DeadSnakes;

Using third-party modules packaged for Debian or Ubuntu with the Python
interpreters from this repository is a bit of a mixed bag. For Python 2, Python
modules from the official repositories will not work, as a consequence of how
Python packaging works in Debian. For Python 3 on the other hand, all
pure-Python module packages at least should be available; compiled extension
modules will not work however.

In general, you're better off installing Python modules using the common Python
packaging tools rather than the system package manager. For an introduction into
the Python packaging ecosystem and its tools, refer to;

A few of these tools might also be provided in this repository as a convenience.

If you are absolutely required to use the operating systems package management, and are unable to move to a different version of Ubuntu with a package provided by DeadSnakes, or natively, than you only have two options left, as I see it.

  1. You could request a backport of Python 2.7.5 to Ubuntu 12.04.
  2. You could create your own PPA with the version of Python you require.

side note: AskUbuntu is a better StackExchange to post stuff like this to, than SuperUser generally.

share|improve this answer
Perfect, thanks! In your experience, is DeadSnakes well maintained? – Will Jun 4 '13 at 6:24
Yes, it does seem to be popular and well maintained. I'd have little reservation using it. – krondor Jun 8 '13 at 13:09
It only has 2.7.4 for 10.04 not for 12.04 – Anthon Jun 10 '13 at 12:20
@Anthon you are correct, I didn't notice that. DeadSnakes will not replace a major release, so since Ubuntu already bundles Python 2.7, Deadsnakes will not provide point releases for that series. Rather they provide 3.3 for Precise. This will not help the OP in this case. – krondor Jun 13 '13 at 17:45

Felix Krull also maintains a PPA with the latest Python 2.7 release. You can use the same process like krondor describes, but use instead or additionaly this PPA: ppa:fkrull/deadsnakes-python2.7. It also has packages for Ubuntu Precise Pangolin / 12.04 LTS available.

sudo add-apt-repository ppa:fkrull/deadsnakes-python2.7
sudo apt-get update
sudo apt-get install python2.7
share|improve this answer
This should be the accepted answer. – cr8ivecodesmith Jan 11 at 7:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .