CentOS 6.3 升级 Python 2.7.5
今天看到 Google App Engine 支持PHP啦,在 CentOS 安装 PHP SDK 需要 Python 2.7
而 CentOS 6.3 自带的是 Python 2.6.6
查看
# python -V
Python 2.6.6
下载
# wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
# tar jxvf Python-2.7.5.tar.bz2
# cd Python-2.7.5
# tar jxvf Python-2.7.5.tar.bz2
# cd Python-2.7.5
安装
# ./configure
# make all
# make install
# make clean
# make distclean
# /usr/local/bin/python2.7 -V
Python 2.7.5
# make all
# make install
# make clean
# make distclean
# /usr/local/bin/python2.7 -V
Python 2.7.5
修改软链
# mv /usr/bin/python /usr/bin/python2.6.6
# ln -s /usr/local/bin/python2.7 /usr/bin/python
# python -V
# ln -s /usr/local/bin/python2.7 /usr/bin/python
# python -V
Python 软链接指向python2.7版本后, yum 不能正常工作
# vim /usr/bin/yum
将文件头部的
#!/usr/bin/python
改成
#!/usr/bin/python2.6.6