centos7更换阿里云镜像

in with 0 comment

某些主机提供商使用的是清华大学的源,导致有些依赖无法安装,推荐更换阿里云的源解决。
centos7更换阿里云镜像

国内镜像源有很多,阿里云是个不错的选择,一个好的镜像源可以加快Centos7系统的更新升级或安装软件的速度
1
备份原来的yum源

 cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 

1
设置aliyun的yum源

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

1
添加EPEL源

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

1
清理缓存并生成新的缓存

yum clean all  
 yum makecache
Responses