aliyun更新了centos8的说明:https://developer.aliyun.com/mirror/centos
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
centos 8 默认是会读取centos.org的mirrorlist的,所以一般来说是不需要配置镜像的。
如果你的网络访问centos.org的mirrorlist有问题,可能才需要另外配置镜像
cd /etc/yum.repos.d
#备份
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
把服务器的包下载到本地缓存
[root@hdp1 yum.repos.d]# yum makecache
最后
以上就是执着夏天最近收集整理的关于CentOS8 换yum源,设置dnf / yum镜像的全部内容,更多相关CentOS8内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复