CentOS 8 EOL如何切换源?
一、为啥centos8要换源?
当前时间是2022年2月22号
2021年12月31日CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。后续新的服务器建议使用CentOS Stream,或者其他linux版本,按照社区规则,CentOS 8的源地址http://mirror.centos.org/centos/8/内容已移除,目前第三方的镜像站中均已移除CentOS 8的源。但是对于业务过渡期仍然需要使用centos8,并且在上面安装软件,那我们需要更新备用源,之前第三方的源都是同步centos官方的,并随之更新,官方的源去掉后,第三方也就无法同步到了,所以第三方的源也就不复存在了,但是大部分第三方都把最后的源做了个备份弄了个新的地址,方便过渡期使用。当然切换到阿里云的源速度也会更快些。
阿里云镜像站官网:https://developer.aliyun.com/mirror/
阿里云centos源地址:https://developer.aliyun.com/mirror/centos
二、如何更换centos8源的阿里云镜像地址
两种情况,阿里云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.backup
wget -O /etc/yum.repos.d/CentOS-Base.repohttps://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all && yum makecache
阿里云服务器用户:
mv /etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repohttps://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
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.repo
yum clean all && yum makecache
三、其他工具换源
推荐使用linux一键换源脚本,https://supermanito.github.io/LinuxMirrors/#/
不仅支持centos,还支持其他linux发行版本,感谢原作者的无私奉献。
Gitee地址:https://gitee.com/SuperManito/LinuxMirrors
更多相关文章
- Eclipse阿里云镜像源配置
- Grafana镜像在阿里云镜像站首发上线
- 分享:十年阿里架构师教你如何阅读Java源码
- Ubuntu18.04..5 配置国内镜像源:解决E: Failed to fetch
- 开发常用镜像站 - 阿里云镜像站
- 使用阿里巴巴开源镜像站镜像——Kubernetes 镜像
- 使用阿里云镜像站NTP服务搭建NTP服务器(基于CentOS 7系统)
- 切换阿里巴巴开源镜像站镜像——Kali镜像
- 阿里云镜像Centos安装PHP