RHEL configure Centos yum Source
Because RHEL's yum online update is charged, it cannot be used if it is not registered, that is, it cannot install software online. In this case, if we use a machine to install the RHEL system, it will be very complicated to mount the local disc first after each software installation, and some software is also of the old version, in this case, we can use the CentOS YUM source to meet our needs.
1. Delete the original YUM of RHEL.
rpm-aq|
grep
yum|
xargs
rpm-e--nodeps
Ii. Download The CentOS yum installation package (source 163)
wgethttp:
//mirrors
.163.com
/centos/5/os/x86_64/CentOS/yum-3
.2.22-40.el5.centos.noarch.rpm
wgethttp:
//mirrors
.163.com
/centos/5/os/x86_64/CentOS/yum-fastestmirror-1
.1.16-21.el5.centos.noarch.rpm
wgethttp:
//mirrors
.163.com
/centos/5/os/x86_64/CentOS/yum-metadata-parser-1
.1.2-4.el5.x86_64.rpm
wgethttp:
//mirrors
.163.com
/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
3. Install CentOS YUM installation package
Yum and yum-plugin-fastestmirror need to be installed together, the two packages have dependencies, separate installation will fail, before the installation first import the RPM-GPG-KEY into the system, otherwise there will be a warning
rpm-ivhyum-metadata-parser-1.1.2-4.el5.x86_64.rpm
rpm--
import
RPM-GPG-KEY-CentOS-5
rpm–ivhyum-3.2.22-40.el5.centos.noarch.rpmyum-fastestmirror-1.1.16-21.el5.centos.noarch.
rm
Now we can use yum online.
4. Modify yum Source
To use online Yum to install software faster, we can use domestic Netease Yum sources or other domestic yum sources
5. Change yum source # Use the CentOS image source of Netease
cd
/etc/yum
.repos.d/
vi
rhel-debuginfo.repo
#CentOS-Base.repo
#
#ThemirrorsystemusestheconnectingIPaddressoftheclientandthe
#updatestatusofeachmirrortopickmirrorsthatareupdatedtoand
#geographicallyclosetotheclient.YoushouldusethisforCentOSupdates
#unlessyouaremanuallypickingothermirrors.
#
#Ifthemirrorlist=doesnotworkforyou,asafallbackyoucantrythe
#remarkedoutbaseurl=lineinstead.
#
#
[base]
name=CentOS-5-Base-163.com
mirrorlist=http:
//mirrorlist
.centos.org/?release=5&arch=$basearch&repo=os
baseurl=http:
//mirrors
.163.com
/centos/5/os/
$basearch/
gpgcheck=1
gpgkey=
file
:
///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#releasedupdates
[updates]
name=CentOS-5-Updates-163.com
mirrorlist=http:
//mirrorlist
.centos.org/?release=5&arch=$basearch&repo=updates
baseurl=http:
//mirrors
.163.com
/centos/5/updates/
$basearch/
gpgcheck=1
gpgkey=
file
:
///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#packagesused/producedinthebuildbutnotreleased
[addons]
name=CentOS-5-Addons-163.com
mirrorlist=http:
//mirrorlist
.centos.org/?release=5&arch=$basearch&repo=addons
baseurl=http:
//mirrors
.163.com
/centos/5/addons/
$basearch/
gpgcheck=1
gpgkey=
file
:
///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additionalpackagesthatmaybeuseful
[extras]
name=CentOS-5-Extras-163.com
mirrorlist=http:
//mirrorlist
.centos.org/?release=5&arch=$basearch&repo=extras
baseurl=http:
//mirrors
.163.com
/centos/5/extras/
$basearch/
gpgcheck=1
gpgkey=
file
:
///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additionalpackagesthatextendfunctionalityofexistingpackages
[centosplus]
name=CentOS-5-Plus-163.com
mirrorlist=http:
//mirrorlist
.centos.org/?release=5&arch=$basearch&repo=centosplus
baseurl=http:
//mirrors
.163.com
/centos/5/centosplus/
$basearch/
gpgcheck=1
enabled=0
gpgkey=
file
:
///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#contrib-packagesbyCentosUsers
[contrib]
name=CentOS-5-Contrib-163.com
mirrorlist=http:
//mirrorlist
.centos.org/?release=5&arch=$basearch&repo=contrib
baseurl=http:
//mirrors
.163.com
/centos/5/contrib/
$basearch/
gpgcheck=1
enabled=0
gpgkey=
file
:
///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Vi. Cleanup
yumcleanall
yummakecache
VII. Update
yumupdate
Blog reference: http://pvbutler.blog.51cto.com/7662323/1320908