1、将源文件备份
代码语言:javascript复制cd /etc/yum.repos.d/ && mkdir backup && mv *repo backup/
2、下载源文件
代码语言:javascript复制curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
3、更新源里面的地址
代码语言:javascript复制sed -i -e "s|mirrors.cloud.aliyuncs.com|mirrors.aliyun.com|g " /etc/yum.repos.d/CentOS-*
sed -i -e "s|releasever|releasever-stream|g" /etc/yum.repos.d/CentOS-*
4、生成缓存
代码语言:javascript复制yum clean all && yum makecache