[原创吐血修复RHEL5上的yum错误_VMware, Unix及操作系统讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  VMware, Unix及操作系统讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 5463 | 回复: 0   主题: [原创吐血修复RHEL5上的yum错误        下一篇 
luxiaofan
注册用户
等级:上尉
经验:705
发帖:67
精华:0
注册:2012-10-8
状态:离线
发送短消息息给luxiaofan 加好友    发送短消息息给luxiaofan 发消息
发表于: IP:您无权察看 2012-10-12 14:42:28 | [全部帖] [楼主帖] 楼主

    因为之前在使用的RedHat el5上自己对yum进行了很多改动,换成centos的源有更新python版本,造成今天yum不能正常使用,报错:

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
/usr/lib/python2.4/site-packages/_sqlitecache.so: wrong ELF class: ELFCLASS32
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.4.3 (#1, Dec 10 2010, 17:24:35)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq


辗转各处查询说就是因为Centos和python的版本不匹配,在试过各种解决办法都行不通之后决定现在所有的yum包,然后再重新装一个Centos的yum源。

首先要彻底删除RHEL上的yum:rpm -aq|grep yum|xargs rpm -e --nodeps

下载新的Centos5的yum源码包:

wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
wget http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm


安装所下载的yum包:

rpm -ivh --nodeps \python-iniparse-0.2.3-4.el5.noarch.rpm \yum-3.2.22-39.el5.centos.noarch.rpm \yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm \yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm


然后给Centos的yum编辑匹配的配置文件,保存到到/etc/yum.repo.d下,内容如下:

[base]
name=CentOS-5 - Base
repo=os
baseurl=http://mirrors.163.com/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5
#released updates
[update]
name=CentOS-5 - Updates
baseurl=http://mirrors.163.com/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
baseurl=http://mirrors.163.com/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
baseurl=http://mirrors.163.com/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
baseurl=http://mirrors.163.com/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
baseurl=http://mirrors.163.com/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5


        配置文件写好保存之后,就算是安装完毕了。这时再执行yum就不会报错了,然后yum -y update将必要的yum组件更新一下就好了。




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论