centos6.6升级python

需求:python 2.6.6升级到python 2.7.9

  1. wgt https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tg

  2. tar xf Python-2.7.9.tgz

  3. cd Python-2.7.9

  4. ./configure
    make all
    make install
    make clean
    make distclean

  5. 按装后python -V 查看当前版本还是python 2.6.6

  6. mv /usr/bin/python /usr/bin/python2.6.6

  7. ln -s /usr/local/bin/python2.7 /usr/bin/python

    查看版本是python 2.7.9

  8. 此时yum不能正常使用,需要做调整

    vim /usr/bin/yum

    将文件头部的
    #!/usr/bin/python
    改成
    #!/usr/bin/python2.6.6

你可能感兴趣的:(centos,python,local)