1. Modify the source configuration file /etc/yum.repos.d/rhel-debuginfo.repo
Add the following to the content:
[Base]
Name=Red Hat Enterprise Linux $releasever-base
#mirrorlist =http://mirrorlist.centos.org/?release= $releasever 5&arch= $basearch &reo=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 and 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 could 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
#additional packages that extend functionality of existing packages
[Centosplus]
Name=Red Hat Enterprise Linux $releasever-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=Red Hat Enterprise Linux $releasever-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
# VI Dag.repo
[Dag]
Name=dag RPM Repository for RHEL5
baseurl=http://ftp.riken.jp/linux/dag/redhat/el5/en/$basearch/dag/
Enabled=1
Gpgcheck=1
Gpgkey=http://ftp.riken.jp/linux/dag/packages/rpm-gpg-key.dag.txt
2. import key
# rpm--import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
3.. If there is an error in the result:
Warning:rpmts_HdrFromFdno:Header V3 DSA Signature:nokey, key ID 6b8d79e6
GPG Key retrieval failed: [Errno] HTTP Error 404:not Found
will all gpgcheck=1 Change into gpgcheck=0 can be.
This article is from the "Tangjilinux" blog, make sure to keep this source http://1132818999.blog.51cto.com/10422963/1707735
Red hat is not registered and uses the Yum workaround