1. 卸载掉原先的Yum

    rpm -qa | grep yum | xargs rpm -e --nodeps
    rpm -qa |grep python-urlgrabber|xargs rpm -e --nodeps
  2. 下载新的Yum

    wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm
    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-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
    wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
    wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
  3. 安装包

    rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
    rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
    rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
    rpm -ivh yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm yum-3.2.29-73.el6.centos.noarch.rpm
    注意:yum的包最好一起安装,是有依赖的
  4. 更改源地址

    cd /etc/yum.repos.d/
    mv rhel-source.repo rhel-source.repo_bak
    wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
    mv CentOS6-Base-163.repo CentOS-Base.repo
    sed -i "s;\$releasever;6;g" CentOS-Base.repo
  5. 愉快的Yum update

标签: none

仅有一条评论

  1. 文章虽然写的很精简,解决了困扰我好几天的问题。必须给楼主点个赞

添加新评论