centos7配置阿里云镜像源

国内访问centos官方镜像源速度还是跟阿里云镜像源有差距

这里记录下如何配置阿里云镜像源,包括基础包镜像源和epel镜像源

centos镜像源文件放在了目录 /etc/yum.repos.d

我一般是不保留原来的镜像源文件的,如果你想保留用mv命令修改一下名称

首先下载wget

yum install wget

删除原有的镜像源文件

rm -f /etc/yum.repos.d/*

下载基础源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

下载epel源

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

最后更新镜像源

yum clean all
yum makecache

 

猜你喜欢

转载自blog.csdn.net/wh_computers/article/details/115409292