Debian 源更改

在这里整理一下常用的 Debian 镜像站点,方便在生产环境中使用

简介

Debian 是核心包管理,包格式是.deb,可以使用 APT 将软件包安装到系统上。

APT 是 Debian 中使用的软件包管理器及它衍生工具,APT 代表 Advanced Package Tool,它是一组用于管理 Debian 软件包的工具,因此在Debian系统上它可以安装的所有应用程序。

APT能够解决依赖问题,并从包存储库中检索请求的包,它将软件包的实际安装和删除委托给 dpkg(低级核心Debian Package工具)

Debian从文件/etc/apt/sources.list中获取包的源列表。

sources.list文件由 存档类型 存储库URL 发行版 组件四部分组成

存档类型(Archive type)
每一行的第一条条目 debdeb-src 表示存储库归档的类型。

deb 表示提供的 URL 中的存储库包含预先编译的包
deb-src 表示带有 Debian 控制文件(.dsc )和 diff.gz 的源包

存储库URL(Repository URL)
可以从Debian Worldwide sources list镜像中找到 Debian 仓库的主列表。

发行版(Distribution)
发行版可以是发布代码名/别名(jessie, stretch ,buster ,bullseye, sid),也可以是发行类别(oldoldstable, oldstable , stable , testing , unstable)。

组件
通常有三个组件可以在 Debian 上使用,即:

1
2
3
main     包含作为 Debian 发行版一部分的软件包,这些包符合 DFSG
contrib 软件包是符合 DFSG 的,但是软件包不在主仓库中
nofree 与 DFSG 不兼容的软件包

具体区别可移步官网

站点列表

Debian版本根据自己的实际情况进行替换

由于网络情况的不同,站点分为国内和国外

国内

国内常用的有阿里云和网易镜像站

阿里云镜像站

1
2
3
4
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

网易镜像站

1
2
3
4
deb http://mirrors.163.com/debian/ buster main non-free contrib
deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb http://mirrors.163.com/debian/ buster-backports main non-free contrib

网易镜像站只有 amd64 i386两种架构的包

国外

国外常用的镜像站为 CloudFront

该服务由 Amazon Web Services托管,作为世界第一云服务厂商,稳定性是不用担心的

1
2
3
4
deb http://cloudfront.debian.net/debian buster main contrib non-free
deb http://cloudfront.debian.net/debian-security buster/updates main contrib non-free
deb http://cloudfront.debian.net/debian buster-updates main contrib non-free
deb http://cloudfront.debian.net/debian buster-backports main contrib non-free

镜像汇总

世界上还有很多镜像站,可以根据自己服务器所在的地区进行查询。
镜像站查询可访问官网网站

如果想方便一下,可以使用 Debian Sources List Generator一键生成 source.list