CentOS 6 停产后如何修复yum?
2023-03-15 22:40:39 时间
概述
![CentOS 6 停产后如何修复 yum?](https://s5.51cto.com/oss/202110/13/f32bfa01f0865eb3b3038d64767be33b.jpg)
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
![CentOS 6 停产后如何修复 yum?](https://s5.51cto.com/oss/202110/13/41d51523cf28f9b7684aa461b4bb4b82.jpg)
更换yum源
CentOS官方:http://vault.centos.org/
阿里云镜像:
http://mirrors.aliyun.com/centos-vault/
![CentOS 6 停产后如何修复 yum?](https://s4.51cto.com/oss/202110/13/7cc6de9900a048fafa944acae3c01be4.jpg)
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/CentOS-SCLo-scl-rh.repo
相关文章
- 从数组Reduce中构建Map等12个函数
- 21道关于性能优化的面试题(附答案)
- 内容非常详细!领略Eslint代码检查的四种姿势
- 爱上谷歌文档Docs的十大理由
- 一篇文章教会你使用SVG 画多边形
- Python 30秒就能学会的漂亮短代码
- 1次订单事故,扣了我3个月绩效!
- 无代码将成为软件开发从代码语言向业务语言进化的拐点
- 优秀程序员是如何处理糟糕代码的
- 我用今日头条的算法逻辑,重新设计了MacOS
- 每个人都应该懂点函数式编程
- 设计模式系列|之外观(门面)模式
- 据说精通Git的程序员,都用过这个开源项目
- 程序大作战,萌出一脸血!
- Java 8新特性之旅:使用Stream API处理集合
- 程序员真的是吃青春饭吗?不是这样的!
- 亲爱的程序猿们怎么找工作
- 程序员的年龄天花板
- 程序员的三年创业之路
- 程序员未来发展三大方向