From:http://www.myexception.cn/operating-system/484974.html
centos 5.5 升级python 2.4.3到python 2.6.6,并处理sqlite3库
centos 5.5 默认没有安装sqlite-devel,所以要先安装sqlite-devel,再编译升级python,才可以使用sqlite3库。
1、先安装sqlite-devel:
# yum install sqlite-devel -y
2、之后下载编译安装python 2.6.6
# wget -c http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tar.bz2 # tar jxvf Python-2.6.6.tar.bz2 # cd Python-2.6.6 # ./configure # make && make install
3、更改系统默认版本
# mv /usr/bin/python /usr/bin/python.bak # ln -s /usr/local/bin/python2.6 /usr/bin/python
OK!
4、修复不能正常工作的yum
因为yum是基于python 2.4.3,所以现在是不可以用的
# vi /usr/bin/yum
把首行显示的 !#/usr/bin/python 修改为 !#/usr/bin/python2.4
保存搞定。
P.S. 部分内容来自《CentOS 5.5 中 Python 升级到 2.6.5》