I searched a lot of articles online today about how to change RHEL6.4 TO THE CentOS source, but they do not work. Later, I integrated various articles, repaired, modified, and finally successfully changed the yum source.
Step 1: Delete the default yum source. The command is as follows:
Rpm-aq | grep yum | xargs rpm-e -- nodeps
Step 2: download the latest yum installation package
Wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6.4/ OS /x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
Wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6.4/ OS /x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
Wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6.4/ OS /x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
Wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6.4/ OS /x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
Some rpm files may not be downloaded. You can download them from other websites.
Step 3: Install yum-related software.
Rpm-ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
Rpm-ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
Rpm-ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
Step 4: Change the yum source, we use Netease's image source, you can go here to http://mirrors.163.com/.help/centos.html to download the latest CentOS-Base.repo file, and then cp to/etc/yum. repos. in the d/directory, replace all $ releasever in the file with the version number, that is, 6 is saved. Finally, name the file as a rhel-source.repo and replace the file with the same name in the original directory.
Step 5: Clear yum Cache
Yum clean all
Yum makecache
The following figure shows that the yum source is successfully replaced.
Loaded plugins: fastestmirror, product-id, submodules-manager
This system is not registered to Red Hat sub‑management. You can use sub‑manager to register.
Determining fastest mirrors
Base | 3.7 kB
Base/group_gz | 212 kB
Base/filelists_db | 5.9 MB
Base/primary_db | 4.4 MB
Base/other_db | 2.7 MB
Extras | 3.4 kB: 00
Extras/filelists_db | 10 kB: 00
Extras/prestodelta | 905 B 00: 00
Extras/primary_db | 18 kB: 00
Extras/other_db | 5.7 kB: 00
Updates | 3.4 kB: 00
Updates/filelists_db | 4.0 MB
Updates/prestodelta | 978 kB: 02
Updates/primary_db | 4.4 MB
Updates/other_db | 661 kB
This article is from the "845586" blog, please be sure to keep this source http://855586.blog.51cto.com/845586/1304460