首页 运维 网络学院 查看内容

RHEL-5配置CentOS-5的yum源

2011-6-10 10:52 486 0

摘要:   相信大部分使用Red Hat Enterprise Linux 5的人都是没有注册的RHEL5,这样导致我们无法使用红帽提供的yum源来更新软件。  由于CentOS-5是RHEL-5的山寨版,所...
关键词: CentOS http basearch mirrorlist releasever Enterprise repo org baseurl mirror

  相信大部分使用Red Hat Enterprise Linux 5的人都是没有注册的RHEL5,这样导致我们无法使用红帽提供的yum源来更新软件。  由于CentOS-5是RHEL-5的山寨版,所以我们可以使用CentOS-5的yum源来达到在RHEL-5下更新软件。  首先备份一下原本的repo文件,这个步骤就不写出来了。  然后在原来的repo文件下,添加以下内容  [base]  name=Red Hat Enterprise Linux $releasever -Base  #mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&repo=os  #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/  baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/  gpgcheck=1  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5  #released updates  [update]  name=Red Hat Enterprise Linux $releasever -Updates  #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates  baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/  gpgcheck=1  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5  #packages used/produced in the build but not released  [addons]  name=Red Hat Enterprise Linux $releasever -Addons  #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons  baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/  gpgcheck=1  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5  #additional packages that may be useful  [extras]  name=Red Hat Enterprise Linux $releasever -Extras  #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras  baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/  gpgcheck=1  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5  注:也可以把RHEL-5自带的repo文件删掉,重新建立一个repo文件,添加以上的内容。  接着导入RPM=KEY  rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5  最后清理以下缓存  yum clean all  到这里就OK了,可以测试一下能否使用  yum list
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部