centos7下更换 yum 源为阿里源

备份旧的配置文件

cd /etc/yum.repos.d/                         # 进入文件夹
mv CentOS-Base.repo CentOS-Base.repo_back    # 备份原始配置文件

下载阿里源的文件

wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 若没有 wget 可使用 curl
curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

清理缓存

yum clean all

重新生成缓存

yum makecache

更新

yum -y update

 

posted on 2022-04-11 11:23  法哈席基  阅读(160)  评论(0编辑  收藏  举报