CentOS 6的yum源配置(最新地址)
CentOS 6 操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您升级操作系统至CentOS 7及以上,如果您的业务过渡期仍需要使用CentOS 6系统中的一些安装包,请根据下文切换CentOS 6的源。
背景信息
2020年11月30日CentOS 6 EOL。按照社区规则,CentOS 6的源地址http://mirror.centos.org/centos-6/内容已移除,目前第三方的镜像站中均已移除CentOS 6的源。阿里云的源http://mirrors.cloud.aliyuncs.com和http://mirrors.aliyun.com也无法同步到CentOS 6的源。
当您在使用默认配置的CentOS 6的源会发生报错。报错示例如下图所示:
## https://www.cnblogs.com/liucx/
解决方法:
CentOS-Base源
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | cat > / etc / yum.repos.d / CentOS - Base.repo <<EOF [base] name = CentOS - 6.10 enabled = 1 failovermethod = priority baseurl = http: / / mirrors.aliyun.com / centos - vault / 6.10 / os / $basearch / gpgcheck = 1 gpgkey = http: / / mirrors.aliyun.com / centos - vault / RPM - GPG - KEY - CentOS - 6 [updates] name = CentOS - 6.10 enabled = 1 failovermethod = priority baseurl = http: / / mirrors.aliyun.com / centos - vault / 6.10 / updates / $basearch / gpgcheck = 1 gpgkey = http: / / mirrors.aliyun.comm / centos - vault / RPM - GPG - KEY - CentOS - 6 [extras] name = CentOS - 6.10 enabled = 1 failovermethod = priority baseurl = http: / / mirrors.aliyun.com / centos - vault / 6.10 / extras / $basearch / gpgcheck = 1 gpgkey = http: / / mirrors.aliyun.com / centos - vault / RPM - GPG - KEY - CentOS - 6 [epel] name = Extra Packages for Enterprise Linux 6 - $basearch enabled = 1 failovermethod = priority baseurl = http: / / mirrors.aliyun.com / epel - archive / 6 / $basearch gpgcheck = 0 gpgkey = http: / / mirrors.aliyun.com / epel - archive / RPM - GPG - KEY - EPEL - 6 EOF |
epel源
1 2 3 4 5 6 7 8 9 | cat > / etc / yum.repos.d / epel.repo <<EOF [epel] name = Extra Packages for Enterprise Linux 6 - $basearch enabled = 1 failovermethod = priority baseurl = http: / / mirrors.aliyuncs.com / epel - archive / 6 / $basearch gpgcheck = 0 gpgkey = http: / / mirrors.aliyuncs.com / epel - archive / RPM - GPG - KEY - EPEL - 6 EOF |
运行以下命令生成缓存
1 2 | yum clean all yum makecache |
参考:https://help.aliyun.com/document_detail/193569.htm
作者:Liucx
E-mail:57349220@qq.com
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?