yum 提示 No module named yum

背景:这两天在做一个项目的负载和读写,redhat 5 x86_64。 还是老套路。要换掉yum..........

换掉以后提示:

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.2 (default, Mar 11 2012, 03:08:10) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]

If you cannot solve this problem yourself, please go to 
the yum faq at:

  http://wiki.linux.duke.edu/YumFaq

-------------------------------------------------------------------------------------------------------------------------------------------------------------

日了狗了。以前换的时候没有出现过这样的情况。搜之!

网上提供的解决方案

修改文件: vim /usr/bin/yum

修改头#!/usr/bin/python  => #!/usr/bin/python2.4

。。。。。。

不好用!

最后按照下面这篇文章的安装方法、好了

http://blog.csdn.net/langeldep/article/details/7348902                              (感谢)


这篇博客里面只安装了

##打开网页 http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/
##找到下列rpm包,下载并安装
yum-3.2.22-26.el5.centos.noarch.rpm
yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm

这三个包。而我之前装了

yum-2.4.3-4.el4.centos.noarch.rpm  
python-elementtree-1.2.6-5.el4.centos.x86_64.rpm 
python-sqlite-1.1.7-1.2.1.x86_64.rpm 
yum-metadata-parser-1.0-8.el4.centos.x86_64.rpm 
python-urlgrabber-2.9.8-2.noarch.rpm

这5个包。所以应该是有冲突了!

如果是redhat6的话可以出门左转!我有一篇更换redhat6 yum 的文章!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值