有奶油 發表於 2019-6-26 23:15:00

CentOS 配置阿里云 yum 源

<h3 id="centos">CentOS</h3>
<h4 id="1备份">1、备份</h4>
<pre><code class="language-bash">mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
</code></pre>
<h4 id="2下载新的centos-baserepo-到etcyumreposd">2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/</h4>
<p><strong>CentOS 5</strong></p>
<pre><code class="language-bash">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
</code></pre>
<p>或者</p>
<pre><code class="language-bash">curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
</code></pre>
<p><strong>CentOS 6</strong></p>
<pre><code class="language-bash">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
</code></pre>
<p>或者</p>
<pre><code class="language-bash">curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
</code></pre>
<p><strong>CentOS 7</strong></p>
<pre><code class="language-bash">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
</code></pre>
<p>或者</p>
<pre><code class="language-bash">curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
</code></pre>
<h4 id="3生成新的缓存">3、生成新的缓存</h4>
<pre><code class="language-bash">yum makecache
</code></pre>
<h3 id="epel-源使用阿里云">epel 源使用阿里云</h3>
<p>centos7</p>
<pre><code>mv/etc/yum.repos.d/epel.repo   /etc/yum.repos.d/epel.repo.bak
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
</code></pre>


</div>
<div id="MySignature" role="contentinfo">
    <div>作者:理想三旬</div>
<div>出处:</div>
<div> 本人承接各种项目维护和python项目开发, 如果觉得文章写得不错,或者帮助到您了,请点个赞,加个关注哦。运维学习交流群:544692191 </div><div>本文版权归作者所有,欢迎转载,如果文章有写的不足的地方,或者是写得错误的地方,请你一定要指出,因为这样不光是对我写文章的一种促进,也是一份对后面看此文章的人的责任。谢谢。 </div><br><br>
来源:https://www.cnblogs.com/operationhome/p/11094493.html
頁: [1]
查看完整版本: CentOS 配置阿里云 yum 源