centos6 各个版本 修改yum源
解决目前市面上大多数centos6yum源失效,经过一番捣腾 终于找到适合的源。
1.cd /etc/yum.repos.d
2.mv CentOS-Base.repo CentOS-Base.repo.backup
3.在网上找到阿里的yum源CentOS-Base.repo配置 然后修改里面的网址在https://vault.centos.org/找到你系统版本及相应地址进行替换
4.将修改后CentOS-Base.repo上传到/etc/yum.repos.d目录
centos6.8修改好的示例:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://vault.centos.org/6.8/os/$basearch/
http://vault.centos.org/6.8/os/$basearch/
http://vault.centos.org/6.8/os/$basearch/
gpgcheck=1
gpgkey=http://vault.centos.org/6.8/os/x86_64/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://vault.centos.org/6.8/updates/$basearch/
http://vault.centos.org/6.8/updates/$basearch/
http://vault.centos.org/6.8/updates/$basearch/
gpgcheck=1
gpgkey=http://vault.centos.org/6.8/os/x86_64/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://vault.centos.org/6.8/extras/$basearch/
http://vault.centos.org/6.8/extras/$basearch/
http://vault.centos.org/6.8/extras/$basearch/
gpgcheck=1
gpgkey=http://vault.centos.org/6.8/os/x86_64/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://vault.centos.org/6.8/centosplus/$basearch/
http://vault.centos.org/6.8/centosplus/$basearch/
http://vault.centos.org/6.8/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://vault.centos.org/6.8/os/x86_64/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://vault.centos.org/6.8/contrib/$basearch/
http://vault.centos.org/6.8/contrib/$basearch/
http://vault.centos.org/6.8/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://vault.centos.org/6.8/os/x86_64/RPM-GPG-KEY-CentOS-6
5.清理缓存并生成新的缓存
yum clean all
yum makecache
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构