rpm -aq|grep yum|xargs rpm -e --nodeps
2、安装新的yum
《1》rpm -ivh https://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
注:python-iniparse-0.3.1-2.1.el6.noarch.rpm这个版本可能随着包的更新导致在这个地址上不一定存在,可输入https://mirrors.163.com/centos/6/os/x86_64/Packages(CentOS6),这个页上面有具体包列表,查找python-iniparse的包,修改为正确的地址即可。下面几步和这一步相似。
《2》rpm -ivh https://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
《3》rpm -ivh https://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-60.el6.centos.noarch.rpm https://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
注:这是两个rpm包
《4》cd /etc/yum.repos.d/
《5》wget https://mirrors.163.com/.help/CentOS6-Base-163.repo
《6》sed -i 's/$releasever/6/g' CentOS6-Base-163.repo
《7》yum clean all 清除所有缓存
《8》yum makecache 获取yum列表