[root@controller0 ~]# yum install ntp
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
http://mirrors.163.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
One of the configured repositories failed (CentOS-$releasever - Base - 163.com),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable base
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=base.skip_if_unavailable=true
failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirrors.163.com/centos/$releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
遇到上面的問題,轉載一篇解決方案:http://www.linuxidc.com/Linux/2013-10/90932.htm
=====================================================================================================
今日網上搜索了很多關於RHEL6.4更改為CentOS源的文章,都是按照一步一步去操作,但都是不行的。后來自己綜合了各篇文章,修修改改,終於成功更改了yum源。
第一步:刪除默認的yum源。命令如下
rpm-aq | grep yum|xargs rpm -e--nodeps
第二步:下載最新的yum安裝包
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
第三步:安裝yum相關軟件。
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
第四步:更改yum源,我們使用網易的鏡像源,可以去這里http://mirrors.163.com/.help/centos.html 下載最新的CentOS-Base.repo文件,然后cp到/etc/yum.repos.d/目錄下,修改把文件里面的$releasever全部替換為版本號,即6 最后保存。最后把這個文件命名為rhel-source.repo,替換掉原來該目錄的同名文件。
第五步:清理yum緩存
yum clean all
yum makecache
最后顯示如下,更換yum源成功。
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Determining fastest mirrors
base | 3.7 kB 00:00
base/group_gz | 212 kB 00:00
base/filelists_db | 5.9 MB 00:12
base/primary_db | 4.4 MB 00:09
base/other_db | 2.7 MB 00:05
extras | 3.4 kB 00:00
extras/filelists_db | 10 kB 00:00
extras/prestodelta | 905 B 00:00
extras/primary_db | 18 kB 00:00
extras/other_db | 5.7 kB 00:00
updates | 3.4 kB 00:00
updates/filelists_db | 4.0 MB 00:08
updates/prestodelta | 978 kB 00:02
updates/primary_db | 4.4 MB 00:09
updates/other_db | 661 kB 00:01
