Centos 7,8 更换源

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/

posted on 2022-10-05 17:02  lxxd  阅读(113)  评论(0)    收藏  举报

导航