林梦玉 發表於 2021-5-8 17:04:00

CentOS 6的yum源配置(最新地址)

<p>CentOS 6 操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您升级操作系统至CentOS 7及以上,如果您的业务过渡期仍需要使用CentOS 6系统中的一些安装包,请根据下文切换CentOS 6的源。</p>
<p><span style="font-size: 16px"><strong>背景信息</strong></span><br>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的源。<br>当您在使用默认配置的CentOS 6的源会发生报错。报错示例如下图所示:</p>
<p><img src="https://img2020.cnblogs.com/blog/1463803/202105/1463803-20210508165302045-711324729.png"></p>
<p>##&nbsp; https://www.cnblogs.com/liucx/</p>
<p><span style="font-size: 16px"><strong>解决方法:</strong></span><br><span style="color: rgba(255, 0, 0, 1)">CentOS-Base源</span></p>
<div class="cnblogs_Highlighter">
<pre class="brush:python;gutter:true;">cat &gt; /etc/yum.repos.d/CentOS-Base.repo &lt;&lt;EOF

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

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

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

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
</pre>
</div>
<p><span style="color: rgba(255, 0, 0, 1)">epel源</span></p>
<div class="cnblogs_Highlighter">
<pre class="brush:python;gutter:true;">cat &gt; /etc/yum.repos.d/epel.repo &lt;&lt;EOF

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</pre>
</div>
<p>运行以下命令生成缓存</p>
<div class="cnblogs_Highlighter">
<pre class="brush:python;gutter:true;">yum clean all
yum makecache
</pre>
</div>
<p>参考:https://help.aliyun.com/document_detail/193569.htm</p>

</div>
<div id="MySignature" role="contentinfo">
    <div id="AllanboltSignature">
<div>作者:Liucx</div>
<div id="AllanboltSignature">
<div>E-mail:57349220@qq.com</div>
<div>出处:https://www.cnblogs.com/liucx/</div>
<div>本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.</div>
</div></div><br><br>
来源:https://www.cnblogs.com/liucx/p/14745726.html
頁: [1]
查看完整版本: CentOS 6的yum源配置(最新地址)