Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want Python 2.5, not 3.0.

Can I use yum update for this?

share|improve this question
add comment

migrated from stackoverflow.com Nov 4 '09 at 8:36

This question came from our site for professional and enthusiast programmers.

5 Answers

up vote 4 down vote accepted

Your system python is on 2.4.3 because that's what all the applications in your distro is tested with. You don't want to upgrade or replace that version.

Install Python 2.5 from source instead. I'd recommend keeping it well out of /usr, and installing it in /opt/python25 or something, and running it from there for your custom apps. If you want to install it in /usr or /usr/local, install it with make altinstall so you the python command continues to be python2.4.

share|improve this answer
    
What if one of my applications requires python 2.4? –  Alex Nov 3 '09 at 22:05
    
Then it will be fine, since Python 2.4 will still be the default Python on your system if you follow Lennart's instructions. –  Anonymous Nov 3 '09 at 22:14
1  
Then you run it with Python 2.4. There is no problem with having multiple versions of Python installed. –  Lennart Regebro Nov 3 '09 at 22:14
add comment

You can't upgrade Python with yum - because yum runs in Python, and it will break itself (I've done this, and it sucked).

You need to install either from a stand-alone .rpm or from source.

share|improve this answer
add comment

Don't upgrade the default Python installed with your distro and preferably, don't even use it except for sysadmin tasks that will run on that one box. Instead, build your own Python and install it in either your home directory, or perhaps into /python25 or /python26.

An easy way to do this is to go to this Activestate page and download the binary tarball AS package for your system and architecture. Once you untar this, there is a shell script to run which installs it into the directory of your choice.

I generally name the binary either apy25 or py25 so that I never get confused between the two or more Pythons installed. You might want to link the binary into your /usr/bin and edit your .bashrc as well.

share|improve this answer
add comment

install-python-2-5-on-redhat-centos

That was the second hit when I googled the subject line

share|improve this answer
add comment

If you are happy with python 2.6 then there are well maintained packages available in the EPEL repository. The steps involved would be (as root, or with sudo):

rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install python26

There are quite a few python 2.6 packages in EPEL, you can see the list by doing:

yum search python26

A key advantage of this is that you will get bug fix updates for python 2.6 through yum, along with all your other updates.

(I'm assuming you are on CentOS 5 if python 2.4 is the packaged version).

share|improve this answer
add comment

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.