Red Hat6.5更新163yum源提示错误
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 http://mirrors.163.com/centos/6Server/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found” Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
今天重装red hat 6.5
更新163yum源发现报错如下
于是打开网站发现http://mirrors.163.com/centos/6Server/os/x86_64/repodata/repomd.xml
这时候就扒开163的网站查找发现
http://mirrors.163.com/centos/6Server/os/x86_64/repodata/repomd.xml #是无法打开
http://mirrors.163.com/centos/6/os/x86_64/repodata/repomd.xml #猜测6Server逐级返回查找,找到了源网页地址
于是需要把CentOS-Base.repo中的$releasever全部修改为6
打开CentOS-Base.repo
vi CentOS-Base.repo
在末行模式下执行以下:
:%s/$releasever/6
或者,用sed
sed -i "s/\$releasever/6/" + (repo的文件名)
Esc
-> Shift+: 进入末行模式
修改完保存退出:
Esc -> Shift+: -> wq
清理缓存
重新生成缓存
更新完成!