centos8 阿里云 服务器过期 修改源地址

https://developer.aliyun.com/mirror/centos?&msctype=sms&mscareaid=cn&mscsiteid=cn&mscmsgid=8880122022201206172&&spm=a2c4i.26787838.zh-cnc.1&utm_content=g_1000323853&short_name=f1.KS8C5&app=chrome
CentOS 镜像
简介
CentOS,是基于 Red Hat Linux 提供的可自由使用源代码的企业级 Linux 发行版本;是一个稳定,可预测,可管理和可复制的免费企业级计算平台。

下载地址: https://mirrors.aliyun.com/centos/

相关仓库:
CentOS过期源(centos-vault):https://developer.aliyun.com/mirror/centos-vault

CentOS arm源(centos-altarch):https://developer.aliyun.com/mirror/centos-altarch/

CentOS Stream源(centos-stream):https://developer.aliyun.com/mirror/centos-stream

CentOS debuginfo源(centos-debuginfo):https://developer.aliyun.com/mirror/centos-debuginfo/

配置方法
通知:CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您切换到Anolis或Alinux。如果您的业务过渡期仍需要使用CentOS 8系统中的一些安装包,请根据下文切换CentOS 8的源。

  1. 备份
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  2. 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
    centos8(centos8官方源已下线,建议切换centos-vault源)
    wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
    或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
centos6(centos6官方源已下线,建议切换centos-vault源)

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
3. 运行 yum makecache 生成缓存
4. 其他
非阿里云ECS用户会出现 Couldn’t resolve host ‘mirrors.cloud.aliyuncs.com’ 信息,不影响使用。用户也可自行修改相关配置: eg:

sed -i -e ‘/mirrors.cloud.aliyuncs.com/d’ -e ‘/mirrors.aliyuncs.com/d’ /etc/yum.repos.d/CentOS-Base.repo

CentOS 8 结束生命周期如何切换源
公网用户:
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
阿里云ecs用户:
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

相关链接
官方主页: http://www.centos.org/
邮件列表: https://wiki.centos.org/GettingHelp/ListInfo
论坛: https://forums.centos.org/
文档: http://www.centos.org/docs/
Wiki: http://wiki.centos.org/
特别声明:本镜像站内容来自第三方网站,阿里云会尽力审核镜像内容安全,但无法保证其完全合规,请您在下载前慎重考虑。具体请查看《阿里云开发者社区用户服务协议》、《阿里云镜像站特别条款》等。 如您发现镜像站有任何问题,可以填写镜像站投诉表单举报,我们将按照法律规定尽快进行处理。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是在 CentOS 8 中设置阿里云的安装的步骤: 1. 打开阿里云的 CentOS 8 安装页面:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.4d1f59b7J6NTE9 2. 根据你的 CentOS 8 版本选择相应的 yum ,比如选择 CentOS 8.4 版本的 yum ,复制对应的 BaseRepo 地址,如下所示: ``` https://mirrors.aliyun.com/centos/8.4.2105/BaseOS/x86_64/os/ ``` 3. 打开终端,使用 root 用户登录,并备份原来的 yum 配置文件: ``` mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup ``` 4. 创建一个新的 CentOS-Base.repo 配置文件: ``` vi /etc/yum.repos.d/CentOS-Base.repo ``` 5. 将下面的内容粘贴到 CentOS-Base.repo 配置文件中: ``` [base] name=CentOS-$releasever - Base baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [updates] name=CentOS-$releasever - Updates baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [extras] name=CentOS-$releasever - Extras baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official [epel] name=Extra Packages for Enterprise Linux $releasever - $basearch baseurl=https://mirrors.aliyun.com/epel/$releasever/$basearch gpgcheck=1 gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 enabled=1 ``` 6. 保存并退出 CentOS-Base.repo 配置文件。 7. 运行以下命令更新 yum 缓存: ``` yum makecache ``` 现在你的 CentOS 8 系统就已经成功切换到了阿里云的 yum ,可以使用 yum 命令安装软件包了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值