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”

替换本地yum仓库为线上yum仓库
解决方法,
(把本地yum仓库的repo文件先做备份)
首先下载epel第三方源包epel-release-7-11.noarch.rpm
下载地址:http://mirror.centos.org/centos/7/extras/x86_64/Packages/epel-release-7-11.noarch.rpm
安装:rpm -ivh epel-release-latest-7-11.noarch.rpm
其次下载镜像源的配置文件
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 保存到/etc/yum.repos.d/ 目录下

然后编辑CentOS6-Base-163.repo
把里面的所有的$releasever 更改为centos的系统版本号,比如centos7版本 用:%s/\$releasever/7/g进行全部替换,然后保存 再yum clean all 继续yum makecache 最后yum repolist 就可以了!