cd /etc/yum.repos.d/
# 对于 CentOS 7 sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \ -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.tuna.tsinghua.edu.cn|g' \ -i.bak \ /etc/yum.repos.d/CentOS-*.repo # 对于 CentOS 8 sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \ -e 's|^#baseurl=http://mirror.centos.org/$contentdir|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' \ -i.bak \ /etc/yum.repos.d/CentOS-*.repo
yum makecache
https://mirrors4.tuna.tsinghua.edu.cn/help/centos/
标签:centos,CentOS,baseurl,Centos,mirrorlist,yum,更换,cn From: https://www.cnblogs.com/namedlxd/p/16755887.html