Debian换apt源
<p>要将Debian的apt源设置为国内镜像,可以按照以下步骤进行操作:</p><p>1备份原始的apt源配置文件:</p>
<pre><code class="language-sh">cp /etc/apt/sources.list /etc/apt/sources.list.bak
</code></pre>
<p>2编辑apt源配置文件,将原有的源地址替换为国内镜像源地址。以下是一些常见的国内镜像源地址:</p>
<ul>
<li>阿里云镜像:https://mirrors.aliyun.com/</li>
<li>清华大学镜像:https://mirrors.tuna.tsinghua.edu.cn/</li>
</ul>
<p>3打开 <code>/etc/apt/sources.list</code> 文件进行编辑,将原有的源地址替换为您所选择的国内镜像源地址。例如,如果选择阿里云镜像,可以使用以下命令打开 <code>/etc/apt/sources.list</code> 文件并进行编辑:</p>
<pre><code class="language-bash">vi /etc/apt/sources.list
</code></pre>
<p>4将文件中的原有源地址替换为阿里云镜像地址,如下所示:</p>
<pre><code>deb http://mirrors.aliyun.com/debian/ stable main contrib non-free
</code></pre>
<p>5更新apt源列表:</p>
<pre><code class="language-sh">apt update
</code></pre>
<p>完成以上步骤后,Debian的apt将使用您所选择的国内镜像源进行软件包的下载和更新。您也可以选择其他国内的镜像源,只需将上述命令中的镜像源URL替换为您所选择的镜像源URL即可。</p><br><br>
来源:https://www.cnblogs.com/bmxxfvlog/p/17972677
頁:
[1]