Red Hat Enterprise Linux 6 Configuring the Yum source for CentOS
Introduction: Because the use of Redhat official Yum source needs to register to purchase the Server service, otherwise you will be prompted to register, or can not find the source of Rehat. But CentOS is the free version of Redhat, except for log and some unimportant things, the others are the same. Even the kernel source code is the same. So we can use CentOS's yum source instead of Redhat's Yum source.
"The" "The" "the" "the author of the success of the test," "" "" "" "" "," "" "" "" "" "" "" "" "" ""
Prerequisite: Firewall shutdown, may affect FTP response
1: Uninstall the self-brought with Yum:
Rpm-aq|grep Yum|xargs rpm-e--nodeps
2: Download the CentOS source must file:
yourself to:http://mirrors.163.com/centos/6/os/x86_64 If it's i386, look for these files under http://mirrors.163.com/centos/6/os/i386:
python-iniparse-0.3.1-2.1.el6.noarch.rpm
yum-3.2.29-69.el6.centos.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.i686.rpm
yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
You can also directly:
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-69.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
3: Install these files
RPM-IVH python-iniparse-0.3.1-2.1.el6.noarch.rpm RPM-IVH yum-metadata-parser-1.1.2-16.el6.i686.rpm rpm-iv H yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm: Here are two installed together, otherwise there will be a dependency error
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm
RPM - IVH yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm: here are two installations together, or there will be dependency error
4:cd /etc/yum.repos.d
ls -lh
mv /yum.repos.d/rhel-debuginfo.repo /yum.repos.d/rhel-debuginfo.repo.back
vim /etc/yum.repos.d/CentOS-Base-163.repo
5: Fix the contents of the Centos-base-163.repo
vi /etc/yum.repos.d/CentOS-Base-163.repo
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-6 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
After saving exit:
Yum update
Try: Yum install GCC (test success)
6: Done
This article from "11464235" blog, declined reprint!
Red Hat Enterprise Linux 6 Configuring the Yum source for CentOS