報錯內容:
[root@192 yum.repos.d]# yum repolist
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.
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
http://mirrors.aliyun.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/.
解決辦法:
將騰訊yum源倉庫的$releasever變數都改為7
命令:vim /etc/yum.repos.d/Centos-Base.repo
vim /etc/yum.repos.d/Centos-Epel.repo
命令::%s/$releasever/7/g #文字編輯器中的替換命令
修改完之後執行:
yum makecache