debian社区为debian用户提供了丰富的apt源,其中包含了主要apt源服务器、从apt源服务器以及次要apt源服务器,使用服务器所在地区临近的apt源可以极大的提高软件包的下载速度,自然今天就来简单介绍一下跟换apt源的方法。
更换apt为阿里云镜像
使用nano编辑器打开/etc/apt/sources.list 在文件尾部追加下面的内容,即可使用阿里云镜像apt源
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib deb http://mirrors.aliyun.com/debian-security buster/updates main deb-src http://mirrors.aliyun.com/debian-security buster/updates main deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
编辑完成后,依次ctrl+O 、回车、ctrl+X即可,然后执行apt-get update更新数据库。
更多apt源镜像服务器
163开源镜像apt源
deb http://mirrors.163.com/debian/ buster main non-free contrib deb-src http://mirrors.163.com/debian/ buster main non-free contrib deb http://mirrors.163.com/debian-security buster/updates main deb-src http://mirrors.163.com/debian-security buster/updates main deb http://mirrors.163.com/debian/ buster-updates main non-free contrib deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib deb http://mirrors.163.com/debian/ buster-backports main non-free contrib deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
清华开源镜像apt源
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main non-free contrib deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main non-free contrib deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main deb-src http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main non-free contrib deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main non-free contrib deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main non-free contrib deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main non-free contrib
华为开源镜像apt源
deb https://mirrors.huaweicloud.com/debian/ buster main non-free contrib deb-src https://mirrors.huaweicloud.com/debian/ buster main non-free contrib deb https://mirrors.huaweicloud.com/debian-security buster/updates main deb-src https://mirrors.huaweicloud.com/debian-security buster/updates main deb https://mirrors.huaweicloud.com/debian/ buster-updates main non-free contrib deb-src https://mirrors.huaweicloud.com/debian/ buster-updates main non-free contrib deb https://mirrors.huaweicloud.com/debian/ buster-backports main non-free contrib deb-src https://mirrors.huaweicloud.com/debian/ buster-backports main non-free contrib
小结
使用临近的apt源有利于加速软件下载缓慢问题,部分开源镜像站还提供了cdn加速服务,让下载软件包更加快速。部分主机服务商还提供了内网开源镜像服务,让资源直接走内网下载,软件包下载更快更安全。