陈贝贝 發表於 2022-1-8 18:27:00

ubuntu更换源

<p>&nbsp;</p>
<p>1、备份一下原来的文件</p>
<p>cp /etc/apt/sources.list&nbsp; /etc/apt/sources.list.bak</p>
<p>2、打开source.list文件</p>
<p>vi&nbsp;etc/apt/sources.list</p>
<p>ggVG全部选择&nbsp; &nbsp;d删除</p>
<p>或者直接dG全部删除</p>
<p>3、找到计划使用的源,以aliyun为例,从以下链接内找到对应系统版本的源,拷贝至sources.list,保存即可。</p>
<p>https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11BS9NLJ</p>
<p>我的是ubuntu20.1的版本,用的以下配置:</p>
<p>可以用&nbsp; &nbsp;lsb_release -a 查看一下当前的版本。正常情况也得看对应的codename,如18.04对应的是bionic,20.04对应的是focal。20.1当前是groovy,但因为aliyun尚未提供最新的版本,所以直接用20.04的就行。</p>
<p><img src="https://img2020.cnblogs.com/blog/2020515/202201/2020515-20220108182355488-979603083.png"></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 data-spm-anchor-id="a2c6h.13651104.0.i3.becd94ddcyVvXp">ubuntu 20.04(focal) 配置如下</h3>
<pre><code class="hljs awk" data-spm-anchor-id="a2c6h.13651104.0.i1.becd94ddcyVvXp">deb http:<span class="hljs-regexp">//mirrors.aliyun.com<span class="hljs-regexp">/ubuntu/ <strong>focal</strong> main restricted universe multiverse
deb-src http:<span class="hljs-regexp">//mirrors.aliyun.com<span class="hljs-regexp">/ubuntu/ <strong>focal</strong> main restricted universe multiverse

deb http:<span class="hljs-regexp">//mirrors.aliyun.com<span class="hljs-regexp">/ubuntu/ <strong>focal</strong>-security main restricted universe multiverse
deb-src http:<span class="hljs-regexp">//mirrors.aliyun.com<span class="hljs-regexp">/ubuntu/ focal-security main restricted universe multiverse

deb http:<span class="hljs-regexp">//mirrors.aliyun.com<span class="hljs-regexp">/ubuntu/ <strong>focal</strong>-updates main restricted universe multiverse
deb-src http:<span class="hljs-regexp">//mirrors.aliyun.com<span class="hljs-regexp">/ubuntu/ focal-updates main restricted universe multiverse

deb http:<span class="hljs-regexp">//mirrors.aliyun.com<span class="hljs-regexp">/ubuntu/ <strong>focal</strong>-proposed main restricted universe multiverse
deb-src http:<span class="hljs-regexp">//mirrors.aliyun.com<span class="hljs-regexp">/ubuntu/ focal-proposed main restricted universe multiverse

deb http:<span class="hljs-regexp">//mirrors.aliyun.com<span class="hljs-regexp">/ubuntu/ <strong>focal</strong>-backports main restricted universe multiverse
deb-src http:<span class="hljs-regexp">//mirrors.aliyun.com<span class="hljs-regexp">/ubuntu/ <strong>focal</strong>-backports main restricted universe multiverse</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code></pre>
<p>4、清除配置及更新</p>
<pre class="prettyprint"><code class="has-numbering">apt-get clean
apt-get update
apt-get upgrade</code></pre><br><br>
来源:https://www.cnblogs.com/secman/p/15779124.html
頁: [1]
查看完整版本: ubuntu更换源