linux7配置yum网络源


虚拟机选择网络选择桥接(无线网不打勾)

选择阿里云centos镜像站
1、备份原有的CentOS-Base.repo到/etc/yum.repos.d/目录下,也可移动到自定义目录下
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bk
2、下载新的CentOS-Base.repo到/etc/yum.repos.d/
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、生成缓存
yum makecache

原文地址:https://www.cnblogs.com/dahaoran/p/12951305.html