阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS 6 EOL后如何更换yum源?

33次阅读
没有评论

共计 1554 个字符,预计需要花费 4 分钟才能阅读完成。

导读 CentOS 开发者邮件列表显示,CentOS 6 已于 11 月 30 日 EOL,如果由于某种原因,您被困在 CentOS 操作系统的现在 EOL(生命的尽头) 版本,您将无法再 yum upgrade 成功运行。
概述

CentOS 6 EOL 后如何更换 yum 源?

CentOS 开发者邮件列表显示,CentOS 6 已于 11 月 30 日 EOL,如果由于某种原因,您被困在 CentOS 操作系统的现在 EOL(生命的尽头) 版本,您将无法再 yum upgrade 成功运行。yum upgrade 在 CentOS 6 中运行将产生以下结果:

YumRepo Error: All mirror URLs are not using ftp, http[s] or file.

Eg. Invalid release/repo/arch combination/

removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt

Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

更换 yum 源

CentOS 官方:http://vault.centos.org/

阿里云镜像:

http://mirrors.aliyun.com/centos-vault/

CentOS 6 EOL 后如何更换 yum 源?

1、关闭 fastestmirror
[root@localhost ~]# vi /etc/yum/pluginconf.d/fastestmirror.conf
[main]
enabled=0 #修改为 0
verbose=0
2、替换为官方 Vault 源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
#替换为官方 Vault 源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Centos-6-Vault-Official.repo
3、替换为阿里云 Vault 镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Centos-6-Vault-Aliyun.repo
修复 EPEL 存储库
curl https://www.getpagespeed.com/files/centos6-epel-eol.repo --output /etc/yum.repos.d/epel.repo
修复 SCLO 存储库

包含较新编译软件的存储库 gcc 可通过 Software Collections 获得。

但是,它的存储库同样消失了。改用 Vault 存储库:

yum -y install centos-release-scl
curl https://www.getpagespeed.com/files/centos6-scl-eol.repo --output /etc/yum.repos.d/CentOS-SCLo-scl.repo
curl https://www.getpagespeed.com/files/centos6-scl-rh-eol.repo --output /etc/yum.repos.d/C

阿里云 2 核 2G 服务器 3M 带宽 61 元 1 年,有高配

腾讯云新客低至 82 元 / 年,老客户 99 元 / 年

代金券:在阿里云专用满减优惠券

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2024-07-25发表,共计1554字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中