centos8更改镜像源
[root@liujunjun ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
[root@liujunjun ~]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@liujunjun ~]# yum makecache
阿里云:阿里云社区关于centos8镜像 https://developer.aliyun.com/mirror/centos
sed自行修改
#备份 cp CentOS-Base.repo CentOS-Base.repo.bak cp CentOS-AppStream.repo CentOS-AppStream.repo.bak cp CentOS-Extras.repo CentOS-Extras.repo.bak sed -i 's|mirrorlist=|#mirrorlist=|g' CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo sed -i 's|#baseurl=|baseurl=|g' CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo sed -i 's|http://mirror.centos.org|https://mirrors.aliyun.com|g' CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo