Centos7/8Stream系统更换国内源
对于 CentOS 7,使用以下命令替换默认配置sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.ustc.edu.cn/centos|g' \
-i.bak \
/etc/yum.repos.d/CentOS-Base.repo
对于 CentOS 8 Stream,使用以下命令替换默认的配置
sed -i 's|baseurl=.*$stream|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/centos/$stream|g' /etc/yum.repos.d/CentOS-Stream-*.repo
更换EPEL的源,Centos7/8通用
yum install -y epel-release
sed -i 's|#baseurl|baseurl|g' /etc/yum.repos.d/epe*.repo
sed -i 's|metalink|#metalink|g' /etc/yum.repos.d/epe*.repo
sed -i 's|baseurl=.*/epel/|baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/|g' /etc/yum.repos.d/epe*.repo
页:
[1]