ubuntu更新源
<h2>1.备份原始源文件source.list</h2><p>打开终端,输入:sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak</p>
<p> </p>
<h2>2.修改源文件</h2>
<p>1.继续输入:sudo gedit /etc/apt/sources.list;或者 sudo vim /etc/apt/sources.list</p>
<p>2.输入上面命令后会打开一个TXT文本文档,对此文件进行编辑;</p>
<p>3.删除文档里原来内容,复制下面任意一个源,保存;</p>
<p>4.修改源后,更新软件列表和软件。</p>
<p> <code class="language-bash">sudo apt update</code></p>
<p> sudo apt upgrade</p>
<h2><strong>国内源(18.04)</strong></h2>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">阿里源:</span>
deb http://mirrors.aliyun.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> bionic main restricted universe multiverse
deb http:</span>//mirrors.aliyun.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb http:</span>//mirrors.aliyun.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb http:</span>//mirrors.aliyun.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
deb http:</span>//mirrors.aliyun.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> bionic main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse</pre>
</div>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">中科大</span>
deb https://mirrors.ustc.edu.cn/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> bionic main restricted universe multiverse
deb https:</span>//mirrors.ustc.edu.cn/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb https:</span>//mirrors.ustc.edu.cn/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
deb https:</span>//mirrors.ustc.edu.cn/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb https:</span>//mirrors.ustc.edu.cn/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
deb</span>-src https://mirrors.ustc.edu.cn/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> bionic main restricted universe multiverse
deb</span>-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb</span>-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
deb</span>-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb</span>-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse</pre>
</div>
<div class="cnblogs_code">
<pre>#163<br>deb http://mirrors.163.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> bionic main restricted universe multiverse
deb http:</span>//mirrors.163.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb http:</span>//mirrors.163.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb http:</span>//mirrors.163.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
deb http:</span>//mirrors.163.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
deb</span>-src http://mirrors.163.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> bionic main restricted universe multiverse
deb</span>-src http://mirrors.163.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb</span>-src http://mirrors.163.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb</span>-src http://mirrors.163.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
deb</span>-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse</pre>
</div>
<h2>国内源(ubuntu20.04)</h2>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">阿里源</span>
deb http://mirrors.aliyun.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> focal main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> focal main restricted universe multiverse
deb http:</span>//mirrors.aliyun.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb http:</span>//mirrors.aliyun.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb http:</span>//mirrors.aliyun.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
deb http:</span>//mirrors.aliyun.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse</pre>
</div>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">中科大</span>
deb https://mirrors.ustc.edu.cn/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> focal main restricted universe multiverse
deb</span>-src https://mirrors.ustc.edu.cn/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> focal main restricted universe multiverse
deb https:</span>//mirrors.ustc.edu.cn/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb</span>-src https://mirrors.ustc.edu.cn/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb https:</span>//mirrors.ustc.edu.cn/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
deb</span>-src https://mirrors.ustc.edu.cn/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
deb https:</span>//mirrors.ustc.edu.cn/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb</span>-src https://mirrors.ustc.edu.cn/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb https:</span>//mirrors.ustc.edu.cn/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
deb</span>-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse</pre>
</div>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">163</span>
deb http://mirrors.163.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> focal main restricted universe multiverse
deb http:</span>//mirrors.163.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb http:</span>//mirrors.163.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb http:</span>//mirrors.163.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
deb http:</span>//mirrors.163.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
deb</span>-src http://mirrors.163.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> focal main restricted universe multiverse
deb</span>-src http://mirrors.163.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb</span>-src http://mirrors.163.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb</span>-src http://mirrors.163.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
deb</span>-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse</pre>
</div>
<p> </p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">添加清华源</span>
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> focal main restricted universe multiverse
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse</span>
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse</span>
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse</span>
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse</span></pre>
</div>
<p> </p><br><br>
来源:https://www.cnblogs.com/dzwclimber/p/15086922.html
頁:
[1]