CentOS8换源

CentOS版本:CentOS-8.4.2105-x86_64-dvd1.iso(应该是CentOS 8 Stream版)

替换为科大源:
注:建议先备份原始文件夹

sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org/$contentdir/$releasever|baseurl=https://mirrors.ustc.edu.cn/centos/8-stream|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-Linux-AppStream.repo \
         /etc/yum.repos.d/CentOS-Linux-BaseOS.repo \
         /etc/yum.repos.d/CentOS-Linux-Extras.repo \
         /etc/yum.repos.d/CentOS-Linux-PowerTools.repo

# 更新元数据
yum clean all
yum makecache

你可能感兴趣的:(Linux,linux)