Python – How should I upgrade Python on CentOS 5.5 (64-bit)

centos5pythonyum

I believe I am running CentOS 5.5 (64-bit) on CA AppLogic 3.0.

uname -a says

Linux LINUX64 2.6.18-194.32.1.el5xen #1 SMP Wed Jan 5 18:44:24 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

I have upgrade with yum upgrade, but my Python is still in version 2.4.3.

yum info python says

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.5ninesolutions.com
 * extras: mirrors.cmich.edu
 * updates: mirror.5ninesolutions.com
Installed Packages
Name       : python
Arch       : x86_64
Version    : 2.4.3
Release    : 46.el5
Size       : 72 k
Repo       : installed
Summary    : An interpreted, interactive, object-oriented programming language.
URL        : http://www.python.org/
License    : PSF - see LICENSE
Description: Python is an interpreted, interactive, object-oriented programming
           : language often compared to Tcl, Perl, Scheme or Java. Python
           : includes modules, classes, exceptions, very high level dynamic data
           : types and dynamic typing. Python supports interfaces to many system
           : calls and libraries, as well as to various windowing systems (X11,
           : Motif, Tk, Mac and MFC).
           :
           : Programmers can write new built-in modules for Python in C or C++.
           : Python can be used as an extension language for applications that
           : need a programmable interface. This package contains most of the
           : standard Python modules, as well as modules for interfacing to the
           : Tix widget set for Tk and RPM.
           :
           : Note that documentation for Python is provided in the python-docs
           : package.

I think I read once somewhere that yum depends on python so I shouldn't remove that. So should I download python version 2.7.x as a source and compile it? Or is there a way to upgrade Python with yum (somehow)?

I am planning using the latest version 2.x of Python for Django.

Best Answer

There's python26 package available from epel repo. It should be better and easier option then installing manually.

However, please note that you probably won't be able to replace default python with 2.6 or any other version, as there are a lot of stuff build for 2.4 and upgrading it would require you to rebuild lots of packages and resulting system would not be really CentOS 5. I think it's easier to upgrade to CentOS 6 then to rebuild so much packages.

Related Topic