Python升级(2.7)

下载python安装包

下载地址: wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz

[root@puppet ~]#tar –zxf  Python-2.7.2.tgz

 [root@puppet~]#cd Python-2.7.2 

[root@puppet Python-2.7.2]# ./configure --prefix=/usr/local/python27

 [root@ puppet Python-2.7.2]# make  &make install

 

  [root@puppet Python-2.7.2]# ls /usr/local/python27/ -al

     drwxr-xr-x  6 root root 4096 Jul 14 00:21 .

     drwxr-xr-x 20 root root 4096 Jul 14 00:17 ..

    drwxr-xr-x  2 root root 4096 Jul 14 00:21 bin

    drwxr-xr-x  3 root root 4096 Jul 14 00:21 include

 drwxr-xr-x  4 root root 4096 Jul 14 00:21 lib

drwxr-xr-x  3 root root 4096 Jul 14 00:21 share

覆盖原来的python链接

    [root@puppet Python-2.7.2]# mv /usr/bin/python /usr/bin/python_old

    [root@puppet Python-2.7.2]# ln -s /usr/local/python27/bin/python /usr/bin/

    [root@puppet Python-2.7.2]#python

此时Python2.7升级成功

 [root@puppet Python-2.7.2]# vim /usr/bin/yum 

 #!/usr/bin/python2.6   

此时yum 正常使用

posted on 2016-03-14 15:12  旋风百草  阅读(206)  评论(0编辑  收藏  举报