修改RHEL 6.0 client的yum源到Centos 6

使用yum卸掉自己:yum erase yum

http://mirrors.163.com/centos/6/os/i386/Packages/中找到下面两个文件并下载:

  • yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm
  • yum-3.2.29-22.el6.centos.noarch.rpm
  • 这两个文件在你下载的时候,可能版本号已经不同了,不过没有关系。

使用rpm -ivh yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm  yum-3.2.29-22.el6.centos.noarch.rpm,安装。

在这一步,如果你使用yum install xxx,会得到如下错误:

Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

这是因为:没有修改RHEL的发行版本造成的。

进行如下操作:

  • locate redhat-release
  • locate redhat-indexhtml
  • 通过以上两步得到下面的两个包的名字,然后通过下面命令卸载。
  • server版本可能是:rpm -e --nodeps redhat-release-server-6Server-6.0.0.37.el6.i686 redhat-indexhtml-6-1.el6.noarch
  • client版本可能是:rpm -e --nodeps redhat-release-client-6Client-6.0.0.37.el6.i686 redhat-indexhtml-6-1.el6.noarch(这是我的)

然后,在http://mirrors.163.com/centos/6/os/i386/Packages/找到Centos的对应rpm包:

  • centos-release-6-2.el6.centos.7.i686.rpm
  • centos-indexhtml-6-1.el6.centos.noarch.rpm
  • 安装之:rpm -ivh centos-release-6-2.el6.centos.7.i686.rpm centos-indexhtml-6-1.el6.centos.noarch.rpm

OK


posted @ 2012-06-16 13:28  ray hill  阅读(393)  评论(0编辑  收藏  举报