1.查看当前Python版本
- # python -V
- Python 2.6.6
2.下载Python2.7.5源码
- # wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tgz
- # tar xvf Python-2.7.6.tgz
- # cd Python-2.7.6
- # ./configure
- # make all
- # make install
- # make clean
- # make distclean
5.将系统默认的python设置为python2.7.6
- # rm /usr/bin/python
- # ln -s /usr/local/bin/python2.7 /usr/bin/python
6.检查Python版本
[plain]
- # python -V
- Python 2.7.6
7.解决yum不能运行的问题
因为yum是依赖python2.6.6运行的,所以需要对yum做一些修改
- # vim /usr/bin/yum
将第一行的#!/usr/bin/python修改为#!/usr/bin/python2.6