yum重新安装

yum命令无法使用,

 

1.查看是否安装:

[root@localhost ~]# rpm -qa |grep yum
yum-rhn-plugin-0.9.1-43.el6.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-3.2.29-40.el6.noarch
yum-plugin-security-1.1.30-14.el6.noarch
yum-utils-1.1.30-14.el6.noarch

 

卸载:

[root@localhost ~]#
rpm -qa|grep yum|xargs rpm -e --nodeps

2.使用国内新的centos的yum包替换redhat自带的
找到国内的镜像地址:http://mirrors.163.com/centos/,如图:
http://mirrors.163.com/centos/
选择对应的OS系统版本:

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm 
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

3.从新安装

[root@localhost ~]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
[root@localhost ~]# rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm

#安装yum

[root@localhost ~]#rpm -ivh  yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

 

你可能感兴趣的:(系统运维)