转载自:
centos镜像-centos下载地址-centos安装教程-阿里巴巴开源镜像站
epel镜像-epel下载地址-epel安装教程-阿里巴巴开源镜像站
一、下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
有时候新安装的Centos 7没有wget命令,可以使用curl 进行下载
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
二、下载新repo 到/etc/yum.repos.d/
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
三、下载完成Centos镜像源和Epel 镜像之后,运行 yum makecache 生成缓存
yum clean all && yum makecache