You can use subscription-manager to register解決方法

yum repolist
“Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
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 wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

http://mirrors.163.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://mirrors.163.com/centos/%24releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
http://mirrors.163.com/centos/%24releasever/updates/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
repo id repo name status
base/$releasever/x86_64 CentOS-$releasever - Base - 163.com 0
extras/$releasever/x86_64 CentOS-$releasever - Extras - 163.com 0
updates/$releasever/x86_64 CentOS-$releasever - Updates - 163.com 0
repolist: 0”

解決方法,首先下載鏡像源的配置文件
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

然後編輯CentOS6-Base-163.repo
把裏面的所有的$releasever 更改爲centos的系統版本號,比如centos7版本 用:%s/\$releasever/7/g進行全部替換,然後保存 再yum clean all 繼續yum makecache 最後yum repolist 就可以了!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章