1,查看当前系统Python的版本

# python -V


2,下载Python-2.7.4

# wget https://www.python.org/ftp/python/2.7.4/Python-2.7.4.tar.bz2


3,解压,安装Python-2.7.4

# tar xf Python-2.7.4

# cd Python-2.7.4

# ./configure --prefix=/usr/local/Python-2.7.4

# make all

# make install

# make clean

# make distclean


4,修改系统默认指向Python-2.7.4

# python -V

# mv /usr/bin/python /usr/bin/python2.6.6

# ln -sv /usr/local/Python-2.7.4/bin/python2.7 /usr/bin/python


5,查看当前的Python 版本

# python -V


6,解决系统 Python 软链接指向 Python2.7 版本后,因为yum是不兼容 Python 2.7的,所以yum不能正常工作,我们需要指定 yum 的Python版本

# vim /usr/bin/yum

        #!/usr/bin/python 

修改为

        #!/usr/bin/python2.6.6