Centos6.4 安装完后系统Yum无法使用,解决办法大概如下:
1.检查是否安装了yum包。
rpm -qa | grep yum
2.删除redhat自带的Yum包。
rpm -qa | grep yum | xargs rpm -e --nodeps (不检查依赖,直接卸载yum包)
rpm -qa | grep yum (查询下看是否卸载干净)
3.下载新的yum包,使用Centos 6.5的yum包
1)检查系统的版本号和系统类型:
1
2
3
4
5
6
|
[root@Redhat6 yum.repos.d]
# cat /etc/issue
Red Hat Enterprise Linux Server release 6.4 (Santiago)
Kernel \r on an \m
[root@Redhat6 yum.repos.d]
# uname -a
Linux Redhat6.4 2.6.32-358.el6.x86_64
#1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@Redhat6 yum.repos.d]
#
|
2)根据上一步,找到对应的包,然后下载
1
2
3
4
5
|
mkdir
/root/rpm
wget -P
/root/rpm
http:
//mirrors
.163.com
/centos/6/os/x86_64/Packages/yum-metadata-parser-1
.1.2-16.el6.x86_64.rpm
wget -P
/root/rpm
http:
//mirrors
.163.com
/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1
.1.30-30.el6.noarch.rpm
wget -P
/root/rpm
http:
//mirrors
.163.com
/centos/6/os/x86_64/Packages/yum-3
.2.29-69.el6.centos.noarch.rpm
|
3)安装刚刚下载的rpm包
1
2
|
cd
/root/rpm
rpm -ivh *.rpm
|
4)更改yum源,将原有的的repo文件删除或者备份到别的目录下
4.清楚原有缓存,重建缓存
1)yum clean all
2) yum makecache
5.生成缓存后,可以成功按转软件了,But 标题那句话错误信息还是在,没有深究。
本文转自 xinsir999 51CTO博客,原文链接:http://blog.51cto.com/xinsir/1746681,如需转载请自行联系原作者