配置RHEL使用CENTOS源来YUM

转自http://www.victorchen.org/?p=34

使用rhel(redhat enterprise linux),如果没有购买官方的服务,是没法升级和直接yum安装rpm包的。不过作为穷人嘛,自然有穷人的办法,且看本文。

环境: RHEL5.2 i686

开始进行设置
#cd /etc/yum.repos.d
#cp rhel-debuginfo.repo rhel-debuginfo.repo.orig
#vi rhel-debuginfo.repo

把里面的内容全部替换如下:

[base]
name=Red Hat Enterprise Linux 5.4 -Base
baseurl=http://mirror.nus.edu.sg/centos/5.4/os/$basearch/
gpgcheck=1
[update]
name=Red Hat Enterprise Linux 5.4 -Updates
baseurl=http://mirror.nus.edu.sg/centos/5.4/updates/$basearch/
gpgcheck=1
[extras]
name=Red Hat Enterprise Linux 5.4 -Extras
baseurl=http://mirror.nus.edu.sg/centos/5.4/extras/$basearch/
gpgcheck=1
[addons]
name=Red Hat Enterprise Linux 5.4 -Addons
baseurl=http://mirror.nus.edu.sg/centos/5.4/addons/$basearch/
gpgcheck=1

注意:源是在http://isoredirect.centos.org/centos/5/isos/i386/选择最近的源。

#cd /etc/pki/rpm-gpg
#wget http://mirror.nus.edu.sg/centos/RPM-GPG-KEY-CentOS-5
#rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY*

#rpm -e yum-rhn-plugin-0.5.3-6.el5 –nodeps
这步如果不做,会报错
Error: yum conflicts with yum-rhn-plugin < 0.5.3-30.el5

你可能感兴趣的:(linux,centos,redhat,import)