CentOS 8 EOL如何切换源?

本文涉及的产品
云服务器ECS,u1 2核4GB 1个月
云服务器 ECS,u1 4核8GB 1个月
云服务器 ECS,u1 4核16GB 1个月
简介: 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.repo https://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.repo https://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

 

 

相关实践学习
ECS云服务器新手上路
本实验会自动创建一台ECS实例。首先,远程登陆ECS实例,并部署应用。然后,登陆管理控制台,并对这台ECS实例进行管理操作。
7天玩转云服务器
云服务器ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,可降低 IT 成本,提升运维效率。本课程手把手带你了解ECS、掌握基本操作、动手实操快照管理、镜像管理等。了解产品详情: https://www.aliyun.com/product/ecs
相关文章
|
2月前
|
运维 安全 Linux
CentOS EOL停服--迁移​ 方案
CentOS EOL停服--迁移​ 方案
93 0
|
10天前
|
Linux 虚拟化 数据安全/隐私保护
部署05-VMwareWorkstation中安装CentOS7 Linux操作系统, VMware部署CentOS系统第一步,下载Linux系统,/不要忘, CentOS -7-x86_64-DVD
部署05-VMwareWorkstation中安装CentOS7 Linux操作系统, VMware部署CentOS系统第一步,下载Linux系统,/不要忘, CentOS -7-x86_64-DVD
|
4天前
|
存储 Linux 网络安全
Centos安装Docker的详细安装步骤,Docker相关组件:docker-ce-cli、docker-ce和containerd.io的区别
Centos安装Docker的详细安装步骤,Docker相关组件:docker-ce-cli、docker-ce和containerd.io的区别;CentOS7安装DockerCompose;Docker镜像仓库
|
9天前
|
应用服务中间件 Linux 网络安全
CentOS 7 上安装 Nginx
在 CentOS 7 上安装 Nginx 的步骤包括:添加 EPEL 仓库,安装 Nginx,启动 Nginx,配置防火墙规则,最后通过访问服务器 IP 验证安装是否成功
|
13天前
|
Linux Python
【Elasticsearch】linux使用supervisor常驻Elasticsearch,centos6.10安装 supervisor
【Elasticsearch】linux使用supervisor常驻Elasticsearch,centos6.10安装 supervisor
14 3
|
13天前
|
Ubuntu Linux 虚拟化
VMware安装centos7教程(1)
VMware安装centos7教程(1)
74 1
|
17天前
|
安全 关系型数据库 MySQL
CentOS 8 中安装与配置 MySQL
CentOS 8 中安装与配置 MySQL
84 3
|
18天前
|
缓存 Linux Docker
CentOS 7 下安装 Docker 及配置阿里云加速服务
CentOS 7 下安装 Docker 及配置阿里云加速服务
305 1
|
19天前
|
消息中间件 Linux
Centos安装RabbitMQ
Centos安装RabbitMQ
29 3
|
19天前
|
Linux Docker 容器
Centos8安装Docker
Centos8安装Docker
66 1