获取Python2.7版本的源码包
Python2.7安装
tar xvzf Python-2.7.8.tgzcd Python-2.7.8./configure --prefix=/usr/localmake && make install
拷贝Python头文件
cd /usr/local/include/python2.7cp -a ./* /usr/local/include/
备份旧版本的python并链接新版本的python
cd /usr/binmv python python24ln -s /usr/local/bin/python2.7 /usr/local/bin/pythonrm -f /usr/bin/python cp /usr/local/bin/python2.7 /usr/bin/python
* 修改yum脚本,使其指向旧版本的python,已避免其无法运行*
vim /usr/bin/yum #!/usr/bin/python --> #!/usr/bin/python2.6