Debian 系统如何更换国内源?
安装好 Debian 系统后,我们一般都会把默认源更换为国内源,这样更新的速度以及连接的稳定性都有很大的提高。
1、在做任何修改之前,先备份是一个好的习惯:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2、编辑 /etc/apt/sources.list 源列表文件:
sudo vi /etc/apt/sources.list
输出:现在是官方的默认源

3、默认源替换为国内源:
我们可以使用命令进行替换,本文以 Debian 11 为例:(请根据自己实际情况修改)
将 /etc/apt/sources.list 中默认的源地址 https://deb.debian.org
替换为腾讯云源 https://mirrors.ustc.edu.cn
sudo sed -i 's/deb.debian.org/mirrors.cloud.tencent.com/g' /etc/apt/sources.list
这是修改后的效果:

对于 debian-security
官方源的同步每个镜像源站不一定及时,或者不提供。因此,为了尽快获取安全更新,应该直接使用官方源 http://security.debian.org/debian-security
进行安全更新。
发表评论