龍一吟 發表於 2021-1-11 08:46:00

ubuntu替换国内源(清华,阿里)

<p>ubuntu版本16.04</p>
<p>一、清华源</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#<span style="color: rgba(0, 128, 0, 1)"> 清华大学源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> xenial main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
<span style="color: rgba(0, 128, 0, 1)">#<span style="color: rgba(0, 128, 0, 1)">#測試版源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
<span style="color: rgba(0, 128, 0, 1)">#<span style="color: rgba(0, 128, 0, 1)"> 源碼
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> xenial main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
<span style="color: rgba(0, 128, 0, 1)">#<span style="color: rgba(0, 128, 0, 1)">#測試版源
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></pre>
</div>
<p><code class="prism language-ubuntu has-numbering" style="position: unset">二、阿里源</code></p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#<span style="color: rgba(0, 128, 0, 1)"> 阿里云源
deb http://mirrors.aliyun.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
<span style="color: rgba(0, 128, 0, 1)">#<span style="color: rgba(0, 128, 0, 1)">#測試版源
deb http://mirrors.aliyun.com/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
<span style="color: rgba(0, 128, 0, 1)">#<span style="color: rgba(0, 128, 0, 1)"> 源碼
deb-src http://mirrors.aliyun.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-<span style="color: rgba(0, 0, 0, 1)">backports main restricted universe multiverse
<span style="color: rgba(0, 128, 0, 1)">#<span style="color: rgba(0, 128, 0, 1)">#測試版源
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></pre>
</div>
<p>ubuntu版本18.04</p>
<p>一、清华源</p>
<div class="cnblogs_code">
<pre># 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释<br>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse<br># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse<br>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse<br># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse<br>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse<br># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse<br>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse<br># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse<br><br># 预发布软件源,不建议启用<br># deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse<br># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse<br><br>deb https://download.docker.com/linux/ubuntu bionic stable<br># deb-src https://download.docker.com/linux/ubuntu bionic stable</pre>
</div>
<p><code class="prism language-ubuntu has-numbering" style="position: unset">二、阿里源</code></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 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)">backports main restricted universe multiverse
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">#測試版源</span>
deb http://mirrors.aliyun.com/ubuntu/ bionic-<span style="color: rgba(0, 0, 0, 1)">proposed main restricted universe multiverse
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 源碼</span>
deb-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)">backports main restricted universe multiverse
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">#測試版源</span>
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse</pre>
</div>
<p>&nbsp;ubuntu版本20.04&nbsp;</p>
<p>默认源</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">deb cdrom:/ focal main restricted</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"> newer versions of the distribution.</span>
deb http://cn.archive.ubuntu.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> focal main restricted
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src http://cn.archive.ubuntu.com/ubuntu/ focal main restricted</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"># Major bug fix updates produced after the final release of the</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># distribution.</span>
deb http://cn.archive.ubuntu.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">updates main restricted
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"># N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># team. Also, please note that software in universe WILL NOT receive any</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># review or updates from the Ubuntu security team.</span>
deb http://cn.archive.ubuntu.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> focal universe
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src http://cn.archive.ubuntu.com/ubuntu/ focal universe</span>
deb http://cn.archive.ubuntu.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">updates universe
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"># N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu </span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># team, and may not be under a free licence. Please satisfy yourself as to </span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># your rights to use the software. Also, please note that software in </span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># multiverse WILL NOT receive any review or updates from the Ubuntu</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># security team.</span>
deb http://cn.archive.ubuntu.com/ubuntu/<span style="color: rgba(0, 0, 0, 1)"> focal multiverse
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src http://cn.archive.ubuntu.com/ubuntu/ focal multiverse</span>
deb http://cn.archive.ubuntu.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">updates multiverse
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"># N.B. software from this repository may not have been tested as</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># extensively as that contained in the main release, although it includes</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># newer versions of some applications which may provide useful features.</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># Also, please note that software in backports WILL NOT receive any review</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># or updates from the Ubuntu security team.</span>
deb http://cn.archive.ubuntu.com/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 http://cn.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"># Uncomment the following two lines to add software from Canonical's</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># 'partner' repository.</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># This software is not part of Ubuntu, but is offered by Canonical and the</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"># respective vendors as a service to Ubuntu users.</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"> deb http://archive.canonical.com/ubuntu focal partner</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src http://archive.canonical.com/ubuntu focal partner</span>
<span style="color: rgba(0, 0, 0, 1)">
deb http:</span>//security.ubuntu.com/ubuntu focal-<span style="color: rgba(0, 0, 0, 1)">security main restricted
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src http://security.ubuntu.com/ubuntu focal-security main restricted</span>
deb http://security.ubuntu.com/ubuntu focal-<span style="color: rgba(0, 0, 0, 1)">security universe
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src http://security.ubuntu.com/ubuntu focal-security universe</span>
deb http://security.ubuntu.com/ubuntu focal-<span style="color: rgba(0, 0, 0, 1)">security multiverse
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> deb-src http://security.ubuntu.com/ubuntu focal-security multiverse</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> This system was installed using small removable media</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"> (e.g. netinst, live or single CD). The matching "deb cdrom"</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"> entries were disabled at the end of the installation process.</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"> For information about how to configure apt package sources,</span><span style="color: rgba(0, 128, 0, 1)">
#</span><span style="color: rgba(0, 128, 0, 1)"> see the sources.list(5) manual.</span></pre>
</div>
<p>&nbsp;</p>
<p>阿里源</p>
<div class="cnblogs_code">
<pre>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)">backports main restricted universe multiverse
deb</span>-src http://mirrors.aliyun.com/ubuntu/ focal-<span style="color: rgba(0, 0, 0, 1)">backports 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-proposed main restricted universe multiverse</pre>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>替换方法如下:</p>
<p> 1、备份源文件</p>
<p>  <code class="prism language-Ubuntu has-numbering" style="position: unset">sudo cp /etc/apt/sources.list /etc/apt/sources.list.bcakup</code></p>
<p> 2、打开文件,将上面源copy进来,替换掉原来所有内容</p>
<p>  <code class="prism language-Ubuntu has-numbering" style="position: unset">sudo gedit /etc/apt/sources.list</code></p>
<p> 3、更新软件列表</p>
<p>  <code class="prism language-Ubuntu has-numbering" style="position: unset">sudo apt-get update</code></p>
<p> </p>
<p>&nbsp;</p>

</div>
<div id="MySignature" role="contentinfo">
    人生,从没有一劳永逸 想要变强,只有不停奔跑<br><br>
来源:https://www.cnblogs.com/jimchen1218/p/14260548.html
頁: [1]
查看完整版本: ubuntu替换国内源(清华,阿里)