redhat enterprise 5.0 linux 使用CentOS的更新源
2011-05-11 10:38 htc开发 阅读(192) 评论(0) 编辑 收藏 举报
RHEL系列是使用最广的Linux服务器系统之一,但是对于未付费用户,却无法通过Redhat网络安装和更新软件,这不能不说是一个遗憾。其实我们完全可以通过RHEL的同胞兄弟CentOS的源来更新,步骤如下:
1、在 /etc/yum.repos.d/ 目录下新建一个文件 CentOS-Base.repo
#vi CentOS-Base.repo
2、在该文件中录入以下内容并保存(本例的源在撰写本文时是有效的):
- [base]
- name=CentOS-5 – 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=CentOS-5 – 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=CentOS-5 – 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=CentOS-5 – 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
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-5 – Plus
- #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
- baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/
- gpgcheck=1
- enabled=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
- #contrib – packages by Centos Users
- [contrib]
- name=CentOS-5 – Contrib
- #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
- baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/
- gpgcheck=1
- enabled=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
3、执行更新:
# yum update
4.可能遇到的问题及解决办法
4.1 错误 [warning:rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897]
解决办法:
我用的操作系统是:redhat EL 5
修改文件[/etc/yum.repos.d/rhel-debuginfo.repo]将属性“gpgcheck”的值全部置为“0”,保存即可。
4.2 yum conflicts with yum-rhn-plugin < 0.5.3-30.el5
解决办法:
依照系统提示卸载掉yum-rhn-pugin即可。
[root@test001 ~]#/etc/init.d/yum-updatesd stop
[root@test001 ~]# rpm -q yum-rhn-plugin
[root@test001 ~]#rpm -e --nodeps yum-rhn-pugin-0.5.3-6.el5
这样yum就可以正常使用了。
这样yum就可以正常使用了。