RHEL 5 自带的Python有点旧了,为python-2.3.4-14.4版本的,所以决定升级到版本2.5.2。
如果用
#rpm -e python-2.3.4-14.4
是删除不了的,因为有程序依赖性的问题。
1. 下载最新源代码包
wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2
$ bzip2 -d Python-2.5.2.tar.bz2
$ tar -xvf Python-2.5.2.tar
# ls
Python-2.5.2 Python-2.5.2.tgz python
2. 安装
# mkdir /usr/local/python25 (创建安装目录)
# ./configure --prefix=/usr/local/python25
# make
# make install
3. 创建链接
# mv /usr/bin/python /usr/bin/python_bak (保存原来的版本)
# ln -s /usr/local/python25/bin/python /usr/bin
4. 测试效果
# python
[color=#ff0000]Python 2.5.2[/color] (r252:60911, Sep 11 2008, 16:42:29)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
如果用
#rpm -e python-2.3.4-14.4
是删除不了的,因为有程序依赖性的问题。
1. 下载最新源代码包
wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2
$ bzip2 -d Python-2.5.2.tar.bz2
$ tar -xvf Python-2.5.2.tar
# ls
Python-2.5.2 Python-2.5.2.tgz python
2. 安装
# mkdir /usr/local/python25 (创建安装目录)
# ./configure --prefix=/usr/local/python25
# make
# make install
3. 创建链接
# mv /usr/bin/python /usr/bin/python_bak (保存原来的版本)
# ln -s /usr/local/python25/bin/python /usr/bin
4. 测试效果
# python
[color=#ff0000]Python 2.5.2[/color] (r252:60911, Sep 11 2008, 16:42:29)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>