(1) To make sure Yum is available, if the default Python 2.6 is uninstalled
A. Find the python2.6 RPM package in the packages of the installation disk
B. Execute RPM-UVH--replacepkgs RPM package name. RPM installs the original Python version so Yum can work
(2) First install GCC, with the following command (before installing Python, it is a good idea to check if GCC is installed, otherwise.) The/configure stage will be an error. )
#yum Install GCC gcc-c++
(3) Download 2.7.5
# wget HTTP://PYTHON.ORG/FTP/PYTHON/2.7.5/PYTHON-2.7.5.TAR.BZ2
(4) Start installation
#tar JXVF python-2.7.5.tar.bz2
#cd Python-2.7.5
#./configure
#make
#make Install
(5) Under normal circumstances, even if the python2.7 installation succeeds, the system will point to Python is still version 2.6, and Yum is based on python2.6 to work properly.
So to point the system's default Python to version 2.7.
#/usr/local/bin/python2.7-v
# Mv/usr/bin/python/usr/bin/python.bak
# ln-s/usr/local/bin/python2.7/usr/bin/python
(6) Fix yum error:
A. Run the Yum command at this point and the error will be made. Tip python version is not correct. So the Yum still points to the old python2.6 version:
Vi/usr/bin/yum
B. The first line in the open file, which is the line of code that specifies the Python environment, is modified to:
#!/usr/bin/python2.6
CentOS 6.4 (64bit) installation