centos如何换源?
万事先备份
mkdir -p /etc/yum/backup/
cp -r /etc/yum.repos.d/* /etc/yum/backup/
1、将源文件备份
cd /etc/yum.repos.d/ && mkdir backup && mv *repo backup/
2、下载阿里源文件
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
3、更新源里面的地址
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、生成缓存
yum clean all && yum makecache
标签:centos,etc,repos,repo,如何,换源,yum,backup
From: https://www.cnblogs.com/nwq1101/p/18037642