centos7 更换repo源为阿里

更换repo源为阿里

 

#安装wget 已安装可以略过
yum install -y wget

# 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

# 下载新的CentOS-Base.repo到/etc/yum.repos.d/
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

# 清理并生成缓存
yum clean cache && yum makecache

 

posted @ 2023-02-07 17:08  cansin  阅读(15)  评论(0编辑  收藏  举报