CentOS 7更换镜像源

备份系统之前镜像源:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak            #备份系统镜像源

安装wget:

yum install -y wget            #安装wget

下载CentOS的repo文件:

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

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

更新镜像源:

yum clean all            #清除缓存
yum makecache            #生成缓存

 

posted @ 2021-01-20 17:14  凡是過往;皆為序章  阅读(255)  评论(0编辑  收藏  举报