For some reason, CentOS 5.4, the default Python version is still 2.4. But Python is very important in CentOS, but the 2.4 version of Python has many modules, and the latest version of Python 2.6 adds a lot of advanced features. Therefore, it is necessary to upgrade.
There are many ways to upgrade, one is direct rpm, there is a source code way, the source code is really good, but trouble Ah, but also to compile, quite troublesome.
I searched the internet for a way to create a Python 2.6 rpm package under CentOS 5.4, close-up
1. Download the source code on the website
Cd/usr/src/rehat/sources
wget http://www.python.org/ftp/python/2.6.5/Python-2.6.5.tar.bz2
Tar jxvf python-2.6.5.tar.bz2
CP Python-2.6.5/misc/rpm/python-2.6.spec. /specs
RM-RF Python-2.6.5
Cd.. /specs
2. Start compiling
Rpmbuild-ba Python-2.6.spec
3. After waiting for a long wait, there is a compiled RPM package in the RPM folder.
Source code installation method, old steps, will not speak of.
CentOS 5.4 How to make Python 2.6 RPM Package