14

I occasionally have to work on some legacy Python code that is run by the Python 2.5 interpreter in production. I'd like to set my development environment up just like production, so I need to install the python2.5 family of packages.

Of course, I can install from source, but I'd really prefer to use packages unless there is absolutely no way to do it.

However, the 2.5 packages are not included in any of the apt sources that ship with 11.04. Where can I find Python 2.5 packages that are likely to work smoothly with Natty?

Update: It works! I should have read the apt-get output more closely:

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

So here's what I did to get Python 2.5 installed:

: josh@josh; sudo add-apt-repository ppa:fkrull/deadsnakes
: josh@josh; sudo apt-get update
: josh@josh; sudo apt-get install python2.5
[...]
The following packages have unmet dependencies:
 python-minimal : Breaks: python2.5-minimal (< 2.5.5-7) but 2.5.4-1ubuntu6.1 is to be installed
 python2.5 : Depends: python2.5-minimal (= 2.5.5-8~ppa2~natty3) but 2.5.4-1ubuntu6.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
: josh@josh; sudo apt-get -f install
[...]
The following extra packages will be installed:
  python2.5-minimal
Recommended packages:
      python2.5
The following packages will be upgraded:
  python2.5-minimal
[...]
Do you want to continue [Y/n]? 
[...]
Setting up python2.5-minimal (2.5.5-8~ppa2~natty3) ...
: josh@josh; sudo apt-get install python2.5
The following NEW packages will be installed:
  python2.5
[...]
Braiam
  • 67,791
  • 32
  • 179
  • 269

1 Answers1

12

Launchpad has a topic about this.

Here is a tutorial on installing python 2.5 on Ubuntu 10.10. 11.04 should be identical for this.

From that websites the commands would be:

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

Executing python2.5 file at commandline would execute 'file' with v2.5. python file would use the newest version.

I only used this once roughly a year ago so be wary of pitfalls.

Rinzwind
  • 299,756