centos 8 - 安装阿里yum源
<p>首先进入阿里官网:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11AmH9v0</p><p>官网中给出了详细的配置流程,这里为了方便复制了一份:</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 128, 1)"> 1</span> <span style="color: rgba(0, 0, 0, 1)">配置方法
</span><span style="color: rgba(0, 128, 128, 1)"> 2</span> <span style="color: rgba(0, 0, 0, 1)">通知:CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您切换到Anolis或Alinux。如果您的业务过渡期仍需要使用CentOS 8系统中的一些安装包,请根据下文切换CentOS 8的源。
</span><span style="color: rgba(0, 128, 128, 1)"> 3</span>
<span style="color: rgba(0, 128, 128, 1)"> 4</span> <span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">. 备份
</span><span style="color: rgba(0, 128, 128, 1)"> 5</span> mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-<span style="color: rgba(0, 0, 0, 1)">Base.repo.backup
</span><span style="color: rgba(0, 128, 128, 1)"> 6</span> <span style="color: rgba(128, 0, 128, 1)">2</span>. 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
<span style="color: rgba(0, 128, 128, 1)"> 7</span> centos8(centos8官方源已下线,建议切换centos-<span style="color: rgba(0, 0, 0, 1)">vault源)
</span><span style="color: rgba(0, 128, 128, 1)"> 8</span> wget -O /etc/yum.repos.d/CentOS-Base.repo https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo</span>
<span style="color: rgba(0, 128, 128, 1)"> 9</span> <span style="color: rgba(0, 0, 0, 1)">或者
</span><span style="color: rgba(0, 128, 128, 1)">10</span>
<span style="color: rgba(0, 128, 128, 1)">11</span> curl -o /etc/yum.repos.d/CentOS-Base.repo https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo</span>
<span style="color: rgba(0, 128, 128, 1)">12</span> centos6(centos6官方源已下线,建议切换centos-<span style="color: rgba(0, 0, 0, 1)">vault源)
</span><span style="color: rgba(0, 128, 128, 1)">13</span>
<span style="color: rgba(0, 128, 128, 1)">14</span> wget -O /etc/yum.repos.d/CentOS-Base.repo https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/repo/Centos-vault-6.10.repo</span>
<span style="color: rgba(0, 128, 128, 1)">15</span> <span style="color: rgba(0, 0, 0, 1)">或者
</span><span style="color: rgba(0, 128, 128, 1)">16</span>
<span style="color: rgba(0, 128, 128, 1)">17</span> curl -o /etc/yum.repos.d/CentOS-Base.repo https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/repo/Centos-vault-6.10.repo</span>
<span style="color: rgba(0, 128, 128, 1)">18</span> CentOS <span style="color: rgba(128, 0, 128, 1)">7</span>
<span style="color: rgba(0, 128, 128, 1)">19</span>
<span style="color: rgba(0, 128, 128, 1)">20</span> wget -O /etc/yum.repos.d/CentOS-Base.repo https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/repo/Centos-7.repo</span>
<span style="color: rgba(0, 128, 128, 1)">21</span> <span style="color: rgba(0, 0, 0, 1)">或者
</span><span style="color: rgba(0, 128, 128, 1)">22</span>
<span style="color: rgba(0, 128, 128, 1)">23</span> curl -o /etc/yum.repos.d/CentOS-Base.repo https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/repo/Centos-7.repo</span>
<span style="color: rgba(0, 128, 128, 1)">24</span> <span style="color: rgba(128, 0, 128, 1)">3</span>. 运行 yum makecache 生成缓存</pre>
</div>
<p>其中用到了wget,在centos 8 mini版中没有此命令,可以使用curl。</p>
<p>安装上边的操作安装完以后,下载vim,会得到以下提示信息:</p>
<p><img src="https://img2022.cnblogs.com/blog/1240401/202203/1240401-20220307172618191-1019776572.png"></p>
<p> </p>
<p> 提示信息中说没有匹配到vim,解决此问题也很简单,将/etc/yum.repos.d/目录下除CentOS-Base.repo其他文件全部删除并执行 yum clean all & yum makecache即可。<img src="https://img2022.cnblogs.com/blog/1240401/202203/1240401-20220307172815700-1483141851.png"></p>
<p> </p>
<p> </p>
<p><img src="https://img2022.cnblogs.com/blog/1240401/202203/1240401-20220307172805314-53382475.png"></p>
<p> </p><br><br>
来源:https://www.cnblogs.com/coolYuan/p/15976943.html
頁:
[1]