RHEL6.5下更新python至2.7版本
RHEL6.5下更新python至2.7版本
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 #下载
tar -xvjf Python-2.7.3.tar.bz2.1 #解压
cd Python-2.7.3
mkdir /usr/local/python27
yum install -y gcc
./configure --prefix=/usr/local/python27 #编译
make && make install #安装
mv /usr/bin/python /usr/bin/python_old
ln -s /usr/local/python27/bin/python2.7 /usr/bin/python
python #终端下测试
看是否输出为:
[root@server1 Python-2.7.3]# python
Python 2.7.3 (default, Mar 15 2016, 22:15:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
vim /usr/bin/yum
将 #!/usr/bin/python
改为#!/usr/bin/python2.6
********************此文档之在rhel6.5版本下进行过成功配置