当前位置: 首页 > Linux

如何在CentOS8EOL上切换源?_0

时间:2023-04-06 04:12:33 Linux

1、centos8为什么要换源?当前时间为2022年2月22日和2021年12月31日,CentOS8操作系统版本已经结束生命周期(EOL),Linux社区不再维护该操作系统版本。后续新服务器推荐使用CentOSStream,或者其他linux版本。根据社区规则,CentOS8的源地址http://mirror.centos.org/cent...已被移除,目前所有第三方镜像站均已移除CentOS8的源。但是业务过渡期,还是需要使用centos8,并在其上安装软件,这时我们需要更新备份源。之前,第三方源都是和centos官方同步,相应更新的。官方源去掉后,第三方也无法同步,所以第三方源不存在了,但是大部分第三方都对上次源做了备份,得到了新的地址,就是方便过渡期使用。当然,切换到阿里云的源会更快。阿里云镜像站官网:https://developer.aliyun.com/...阿里云centos源地址:https://developer.aliyun.com/...2、如何替换centos8源2的阿里云镜像地址这种情况下要求阿里云ECS和非阿里云ECS,非阿里云ECS需要能够连接公网。如果阿里云ECS使用阿里云提供的内网链接源而不是阿里云服务器,使用的是公网源,内网源的速度肯定会更快。仔细观察可以发现内网链接:mirrors.cloud.aliyuncs.com公网链接:mirrors.aliyun.com非阿里云服务器用户:mv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backupwget-O/etc/yum.repos.d/CentOS-Base.repohttps://mirrors.aliyun.com/re...yumcleanall&&yummakecache阿里云服务器用户:mv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backupwget-O/etc/yum.repos.d/CentOS-Base.repohttps://mirrors.aliyun.com/re...sed-i's/mirrors.cloud.aliyuncs.com/url_tmp/g'/etc/yum.repos.d/CentOS-Base.repo&&sed-i's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g'/etc/yum.repos.d/CentOS-Base.repo&&sed-i's/url_tmp/mirrors.aliyun.com/g'/etc/yum.repos.d/CentOS-Base.repoyumcleanall&&yummakecache3.其他工具推荐使用linux一键换源脚本。https://supermanito.github.io...不仅支持centos,还支持其他linux发行版,感谢原作者的无私奉献。Gitee地址:https://gitee.com/SuperManito...