Detailed steps for upgrading the Python version of centos
@ For & ever 2010-07-06
The default Python version of centos is 2.4.
Now you need to upgrade python to version 2.5 or above (the same method for upgrading Python 2.6 ).
Because yum is heavily dependent on Python 2.4, we cannot delete the 2.4 version that comes with the original system.
(
You can also use the following solution: Modify the first line of/usr/bin/yum "#! /Usr/bin/Python "is "#! /Usr/bin/python2.4 "</usr/bin/python2.4 is the execution file of Python 2.4 backed up before Upgrade>
However, other thon2.4-dependent systems may still have problems.
).
Therefore, install python2.5 in a new directory.
Steps:
1. DownloadSource codePackage and decompress it
WgetHttp://www.python.org/ftp/python/2.5/Python-2.5.tar.bz2
Tar jxvf Python-2.5.tar.bz2
CD Python-2.5
Ii. Start Installation
./Configure -- prefix =/usr/local ### Note: install it in a new directory to avoid overwriting Python installed by default.
Make
Make install
Iii. Configuration
Ln-S/usr/local/bin/Python/usr/bin/python2.5
Iv. Test
Python
Go to the default Python installation in centos
Python2.5
Go to the python2.5 version we have installed.
In this way, we can retain two different Python versions in the system at the same time.
@ Forandever 2010-07-06