服务器是redhat5,python是2.4,需要升级到2.7
1,下载python2.7和解压
$ wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz $ tar -zxvf Python-2.7.2.tgz
2,安装
$ cd Python-2.7.2 $ ./configure $ make && make install
3,配置
$ mv /usr/bin/python /usr/bin/python2.4-bak $ ln -s /usr/local/bin/python2.7 /usr/bin/python
4,更改yum的python
$ vim /usr/bin/yum #!/usr/bin/python 更改为 #!/usr/bin/python2.4
Leave a Reply