Centos 系统更新Python

本文介绍在CentOS5.4系统中如何将Python从2.4.3版本平滑升级到2.6版本的过程及注意事项。作者分享了避免卸载原有Python版本的方法,并记录了解决依赖问题的具体步骤。

我现在使用的Server是CentOS release 5.4 (Final),但是Python还是2.4.3,比较低了,一直想更新一下。上次强行把Python卸载,导致yum和一些基本的命令用不了了。所以更新千万不要把老版本卸载了,新老版本可以共存的。

在几个外国论坛找到了一些资料,执行下面的命令安装2.6版本的Python:

$rpm -Uvh http://yum.chrislea.com/centos/5/i386/chl-release-5-3.noarch.rpm
$rpm  --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CHL
$rpm -Uvh  http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
$yum install libffi
$yum install python26

最后顺利完成,结果如下:

$ python26
Python 2.6.2 (r262:71600, Sep  8 2009, 13:06:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

这其中也遇到一个错误:

python26-2.6.2-2.i386 from chl has depsolving problems
  --> Missing Dependency: libffi.so.5 is needed by package python26-2.6.2-2.i386 (chl)
Error: Missing Dependency: libffi.so.5 is needed by package python26-2.6.2-2.i386 (chl)

这是因为没有安装程序依赖的libffi,执行第3和第4行命令安装libffi后,问题解决。

 

本文独立博客链接:http://lloydsheng.com/2010/05/how-to-update-python-in-centos.html

转载于:https://www.cnblogs.com/lloydsheng/archive/2010/05/02/1726140.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值