Centos6 升级python2.6.6-->2.7.6

最近弄了个美国的VPS,因为要用来搭梯子,shadowsocks只支持Centos6,所以莫办法,只能装个Centos6,后来发现里面的python只有2.6.6,所以升级了下:

  1. 下源码,解压,配置./configure,编译make,安装make install,默认安装路径:/usr/local/bin/python2.7,没装gcc,编译不了,sudo yum install gcc-c++
  2. 修改符号链接:
    rm -rf /usr/bin/python
    ln -s /usr/local/bin/python2.7 /usr/bin/python
  3. yum用的是2.6的,所以升级之后yum不能用,要修改vim /usr/bin/yum,即#!/usr/bin/python2.6
    python -V
Donate comment here