CentOS8更换yum源为阿里源

1.首先备份当前配置文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2.下载新的 CentOS-Base.repo 到 /etc/yum.repos.d

对于CentOS8

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

对于CentOS7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  1. 运行 yum makecache 生成缓存
yum makecache
posted @ 2021-01-12 19:34  贺秋雨  阅读(9807)  评论(0编辑  收藏  举报