在安装Linux之后,我们通常会先配置起国内软件源加速我们的软件包的安装。今天我将常用的Debian系Linux的国内软件源汇总一下。
1,Debian系软件源格式说明
通常Debian系的Linux配置软件源都是修改/etc/apt/sources.list
文件,或者是在/etc/apt/sources.list.d
中加入一些第三方的软件源文件等等。但是两者文件中格式都是统一的如下:
deb 软件源地址 发行版代号 软件分支1 软件分支2 ...
deb-src 软件源地址 发行版代号 软件分支1 软件分支2 ...
配置项语法很简单,由deb
开头的是表示二进制可执行软件的软件源,而deb-src
开头的是软件源代码。文件中以#
开头的是注释。
通常配置了软件源之后,执行sudo apt update
即可更新软件列表索引。
例如Debian的软件源配置某一行如下:
# Debian 11阿里镜像源某片段
deb https://mirrors.aliyun.com/debian bullseye main non-free contrib
(1) 版本代号/水平划分部分
在上述紧接着配置的地址后的bullseye
就表示该系统版本代号,当前系统版本代号可以通过命令lsb_release -a
查看,输出结果中的Codename
就是当前系统版本代号。
若提示找不到lsb_release
命令,则通过以下命令安装lsb-release
包:
sudo apt install lsb-release
知道了当前系统版本代号之后,我们可以先在浏览器打开镜像源地址,打开后通常是目录形式,在里面我们可以找到所有软件包:
进入其中的dists
文件夹,在里面可以看到所有的系统代号(这个目录中存放的是每个系统代号对应的软件列表索引):
我们这里Debian 11的代号是bullseye
,因此我们可以先在这找到bullseye
代号及其相关部分:
可见包含该系统代号的主要软件包及其水平划分一共有5个,这些是都要加进镜像源的,这五个包含的软件范畴不一样,有的是主要软件,有的是更新软件等等。这说明一个系统代号下的所有软件包会先被水平划分为几个分类。
现在就可以先编辑软件源配置如下:
# 阿里镜像源
deb https://mirrors.aliyun.com/debian bullseye
deb https://mirrors.aliyun.com/debian bullseye-updates
deb https://mirrors.aliyun.com/debian bullseye-proposed-updates
deb https://mirrors.aliyun.com/debian bullseye-backports
deb https://mirrors.aliyun.com/debian bullseye-backports-sloppy
deb-src https://mirrors.aliyun.com/debian bullseye
deb-src https://mirrors.aliyun.com/debian bullseye-updates
deb-src https://mirrors.aliyun.com/debian bullseye-proposed-updates
deb-src https://mirrors.aliyun.com/debian bullseye-backports
deb-src https://mirrors.aliyun.com/debian bullseye-backports-sloppy
好了我们把每个配置项的地址部分和代号部分写完了,但是还没有写软件分支部分,我们接下来看。
(2) 软件分支/垂直划分部分
配置中在紧接着系统代号后的几项就都是软件分支部分了!
还是打开镜像源网址,进入pool
文件夹(这个文件夹就存放的是所有软件包):
可见pool
中有三个目录,这三个目录就代表着Debian三个软件的垂直划分,可见Debian的软件包被划分为下列三种:
main
Debian中符合自由软件规范的软件包contrib
本身属于自由软件但是可能部分依赖非自由软件的软件包non-free
非自由软件
在最新的Debian 12中,增加了
non-free-firmware
这个垂直划分,表示非自由固件。
好了,我们现在可以将上述的软件源配置的分支部分补齐了如下:
# 阿里镜像源
deb https://mirrors.aliyun.com/debian bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian bullseye-proposed-updates main non-free contrib
deb https://mirrors.aliyun.com/debian bullseye-backports main non-free contrib
deb https://mirrors.aliyun.com/debian bullseye-backports-sloppy main non-free contrib
deb-src https://mirrors.aliyun.com/debian bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian bullseye-proposed-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian bullseye-backports-sloppy main non-free contrib
OK,到这里就配置完成了!可见知道了软件源配置格式以及软件源地址,我们就可以自己配置软件源了!
有的发行版每个系统代号对应不同的软件包划分,因此除了查看pool
目录中的软件包划分之外,还可以直接点进dist
目录中的对应的系统代号部分查看:
进入dist
中对应代号的目录,查看其中的目录名即可(文件不管)。
可见Debian发行版的系统代号下的软件包划分是和pool
中的是对应的,如果说不对应则以dist
中每个代号中的垂直划分为准。
Debian除了配置上述主要软件源以外,还有安全更新源,下面会贴出。
其余系统的系统代号部分和软件包划分可能有所不同,例如Ubuntu源中,dists
和pool
中如下:
可见Ubuntu和Debian不同,软件包划分为四个分支,意义也不一样,具体大家可以自行了解。
对于Deepin就很简单了,其没有水平划分:
可见即使是不同的系统,软件源配置方式及其划分方式都是几乎一样的,总结而来如下:
- 水平划分:每个Linux系统的某个版本都有其对应的代号,而该代号版本的系统的所有软件包通常会先按照功能水平划分,例如Debian的
bullseye
代号下所有软件包先被水平划分为了5个类别:bullseye
、bullseye-updates
、bullseye-proposed-updates
、bullseye-backports
和bullseye-backports-sloppy
,水平划分部分可以在软件源网址中的dists
目录中看到,当然不是每个系统的软件包都会水平划分,例如Deepin 20的软件包就没有进行水平划分,那么就直接在dists
中找到其版本代号即可 - 垂直划分:每个水平划分下的软件包通常又会根据软件包自由程度进行垂直划分,而通常一个系统中的每个水平划分下的垂直划分都是一样的。例如Debian中每个水平划分下都垂直划分为了3类:
main
、contrib
和non-free
,在软件源网址中的pool
目录中可以看到垂直划分
2,常用Debian系Linux国内镜像源
修改镜像源配置的方法都基本上一样,修改/etc/apt/sources.list
文件,将里面全部内容先删掉或者注释掉,然后选择下列任意一个镜像站配置内容粘贴进去。
根据自己的操作系统及其版本,选择下面的一个镜像源的配置内容粘贴进sources.list
即可。
(1) Debian
1. 12.x - bookworm
① 阿里云
# 阿里镜像源
deb https://mirrors.aliyun.com/debian bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian bookworm-backports main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
# 阿里安全更新镜像源
deb https://mirrors.aliyun.com/debian-security bookworm-security main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian-security bookworm-security main non-free non-free-firmware contrib
如果你的服务器是阿里云的Debian服务器并且想要给它配置镜像源的话,可以配置阿里云的内网镜像源,这样在阿里云服务器上下载软件会更快:
# 阿里云内网镜像源
deb http://mirrors.cloud.aliyuncs.com/debian bookworm main non-free non-free-firmware contrib
deb http://mirrors.cloud.aliyuncs.com/debian bookworm-updates main non-free non-free-firmware contrib
deb http://mirrors.cloud.aliyuncs.com/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb http://mirrors.cloud.aliyuncs.com/debian bookworm-backports main non-free non-free-firmware contrib
deb http://mirrors.cloud.aliyuncs.com/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm main non-free non-free-firmware contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm-updates main non-free non-free-firmware contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm-backports main non-free non-free-firmware contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
# 阿里云内网安全更新镜像源
deb http://mirrors.cloud.aliyuncs.com/debian-security bookworm-security main non-free non-free-firmware contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian-security bookworm-security main non-free non-free-firmware contrib
② 腾讯云
# 腾讯镜像源
deb https://mirrors.cloud.tencent.com/debian bookworm main non-free non-free-firmware contrib
deb https://mirrors.cloud.tencent.com/debian bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.cloud.tencent.com/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb https://mirrors.cloud.tencent.com/debian bookworm-backports main non-free non-free-firmware contrib
deb https://mirrors.cloud.tencent.com/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
deb-src https://mirrors.cloud.tencent.com/debian bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.cloud.tencent.com/debian bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.cloud.tencent.com/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb-src https://mirrors.cloud.tencent.com/debian bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.cloud.tencent.com/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
# 腾讯安全更新镜像源
deb https://mirrors.cloud.tencent.com/debian-security bookworm-security main non-free non-free-firmware contrib
deb-src https://mirrors.cloud.tencent.com/debian-security bookworm-security main non-free non-free-firmware contrib
同样地,如果你的服务器是腾讯云的Debian服务器并且想要给它配置镜像源的话,可以配置腾讯云的内网镜像源,这样在腾讯云服务器上下载软件会更快:
# 腾讯内网镜像源
deb http://mirrors.tencentyun.com/debian bookworm main non-free non-free-firmware contrib
deb http://mirrors.tencentyun.com/debian bookworm-updates main non-free non-free-firmware contrib
deb http://mirrors.tencentyun.com/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb http://mirrors.tencentyun.com/debian bookworm-backports main non-free non-free-firmware contrib
deb http://mirrors.tencentyun.com/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
deb-src http://mirrors.tencentyun.com/debian bookworm main non-free non-free-firmware contrib
deb-src http://mirrors.tencentyun.com/debian bookworm-updates main non-free non-free-firmware contrib
deb-src http://mirrors.tencentyun.com/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb-src http://mirrors.tencentyun.com/debian bookworm-backports main non-free non-free-firmware contrib
deb-src http://mirrors.tencentyun.com/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
# 腾讯内网安全更新镜像源
deb http://mirrors.tencentyun.com/debian-security bookworm-security main non-free non-free-firmware contrib
deb-src http://mirrors.tencentyun.com/debian-security bookworm-security main non-free non-free-firmware contrib
③ 清华大学镜像站
# 清华大学镜像源
deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm main non-free non-free-firmware contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-backports main non-free non-free-firmware contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
# 清华大学安全更新镜像源
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main non-free non-free-firmware contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main non-free non-free-firmware contrib
④ 中科大镜像站
# 中科大镜像源
deb http://mirrors.ustc.edu.cn/debian bookworm main non-free non-free-firmware contrib
deb http://mirrors.ustc.edu.cn/debian bookworm-updates main non-free non-free-firmware contrib
deb http://mirrors.ustc.edu.cn/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb http://mirrors.ustc.edu.cn/debian bookworm-backports main non-free non-free-firmware contrib
deb http://mirrors.ustc.edu.cn/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
deb-src http://mirrors.ustc.edu.cn/debian bookworm main non-free non-free-firmware contrib
deb-src http://mirrors.ustc.edu.cn/debian bookworm-updates main non-free non-free-firmware contrib
deb-src http://mirrors.ustc.edu.cn/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb-src http://mirrors.ustc.edu.cn/debian bookworm-backports main non-free non-free-firmware contrib
deb-src http://mirrors.ustc.edu.cn/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
# 中科大安全更新镜像源
deb http://mirrors.ustc.edu.cn/debian-security bookworm-security main non-free non-free-firmware contrib
deb-src http://mirrors.ustc.edu.cn/debian-security bookworm-security main non-free non-free-firmware contrib
⑤ 官方镜像
对于位于国外的服务器,推荐使用官方的镜像。
# 官方软件源
deb http://deb.debian.org/debian bookworm main non-free non-free-firmware contrib
deb http://deb.debian.org/debian bookworm-updates main non-free non-free-firmware contrib
deb http://deb.debian.org/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb http://deb.debian.org/debian bookworm-backports main non-free non-free-firmware contrib
deb http://deb.debian.org/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
deb-src http://deb.debian.org/debian bookworm main non-free non-free-firmware contrib
deb-src http://deb.debian.org/debian bookworm-updates main non-free non-free-firmware contrib
deb-src http://deb.debian.org/debian bookworm-proposed-updates main non-free non-free-firmware contrib
deb-src http://deb.debian.org/debian bookworm-backports main non-free non-free-firmware contrib
deb-src http://deb.debian.org/debian bookworm-backports-sloppy main non-free non-free-firmware contrib
# 官网安全更新源
deb http://deb.debian.org/debian-security bookworm-security main non-free non-free-firmware contrib
deb-src http://deb.debian.org/debian-security bookworm-security main non-free non-free-firmware contrib
2. 11.x - bullseye
① 阿里云
# 阿里镜像源
deb https://mirrors.aliyun.com/debian bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian bullseye-proposed-updates main non-free contrib
deb https://mirrors.aliyun.com/debian bullseye-backports main non-free contrib
deb https://mirrors.aliyun.com/debian bullseye-backports-sloppy main non-free contrib
deb-src https://mirrors.aliyun.com/debian bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian bullseye-proposed-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian bullseye-backports-sloppy main non-free contrib
# 阿里安全更新镜像源
deb https://mirrors.aliyun.com/debian-security bullseye-security main non-free contrib
deb-src https://mirrors.aliyun.com/debian-security bullseye-security main non-free contrib
如果你的服务器是阿里云的Debian服务器并且想要给它配置镜像源的话,可以配置阿里云的内网镜像源,这样在阿里云服务器上下载软件会更快:
# 阿里云内网镜像源
deb http://mirrors.cloud.aliyuncs.com/debian bullseye main non-free contrib
deb http://mirrors.cloud.aliyuncs.com/debian bullseye-updates main non-free contrib
deb http://mirrors.cloud.aliyuncs.com/debian bullseye-proposed-updates main non-free contrib
deb http://mirrors.cloud.aliyuncs.com/debian bullseye-backports main non-free contrib
deb http://mirrors.cloud.aliyuncs.com/debian bullseye-backports-sloppy main non-free contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian bullseye main non-free contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian bullseye-updates main non-free contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian bullseye-proposed-updates main non-free contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian bullseye-backports main non-free contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian bullseye-backports-sloppy main non-free contrib
# 阿里云内网安全更新镜像源
deb http://mirrors.cloud.aliyuncs.com/debian-security bullseye-security main non-free contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian-security bullseye-security main non-free contrib
事实上就是改个镜像源地址为内网镜像地址就OK了!
② 腾讯云
# 腾讯镜像源
deb https://mirrors.cloud.tencent.com/debian bullseye main non-free contrib
deb https://mirrors.cloud.tencent.com/debian bullseye-updates main non-free contrib
deb https://mirrors.cloud.tencent.com/debian bullseye-proposed-updates main non-free contrib
deb https://mirrors.cloud.tencent.com/debian bullseye-backports main non-free contrib
deb https://mirrors.cloud.tencent.com/debian bullseye-backports-sloppy main non-free contrib
deb-src https://mirrors.cloud.tencent.com/debian bullseye main non-free contrib
deb-src https://mirrors.cloud.tencent.com/debian bullseye-updates main non-free contrib
deb-src https://mirrors.cloud.tencent.com/debian bullseye-proposed-updates main non-free contrib
deb-src https://mirrors.cloud.tencent.com/debian bullseye-backports main non-free contrib
deb-src https://mirrors.cloud.tencent.com/debian bullseye-backports-sloppy main non-free contrib
# 腾讯安全更新镜像源
deb https://mirrors.cloud.tencent.com/debian-security bullseye-security main non-free contrib
deb-src https://mirrors.cloud.tencent.com/debian-security bullseye-security main non-free contrib
同样地,如果你的服务器是腾讯云的Debian服务器并且想要给它配置镜像源的话,可以配置腾讯云的内网镜像源,这样在腾讯云服务器上下载软件会更快:
# 腾讯云内网镜像源
deb http://mirrors.tencentyun.com/debian bullseye main non-free contrib
deb http://mirrors.tencentyun.com/debian bullseye-updates main non-free contrib
deb http://mirrors.tencentyun.com/debian bullseye-proposed-updates main non-free contrib
deb http://mirrors.tencentyun.com/debian bullseye-backports main non-free contrib
deb http://mirrors.tencentyun.com/debian bullseye-backports-sloppy main non-free contrib
deb-src http://mirrors.tencentyun.com/debian bullseye main non-free contrib
deb-src http://mirrors.tencentyun.com/debian bullseye-updates main non-free contrib
deb-src http://mirrors.tencentyun.com/debian bullseye-proposed-updates main non-free contrib
deb-src http://mirrors.tencentyun.com/debian bullseye-backports main non-free contrib
deb-src http://mirrors.tencentyun.com/debian bullseye-backports-sloppy main non-free contrib
# 腾讯云内网安全更新镜像源
deb http://mirrors.tencentyun.com/debian-security bullseye-security main non-free contrib
deb-src http://mirrors.tencentyun.com/debian-security bullseye-security main non-free contrib
③ 清华大学镜像站
# 清华大学镜像源
deb https://mirrors.tuna.tsinghua.edu.cn/debian bullseye main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-updates main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-proposed-updates main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-backports main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-backports-sloppy main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian bullseye main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-updates main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-proposed-updates main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-backports main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-backports-sloppy main non-free contrib
# 清华大学安全更新镜像源
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main non-free contrib
④ 中科大镜像站
# 中科大镜像源
deb http://mirrors.ustc.edu.cn/debian bullseye main non-free contrib
deb http://mirrors.ustc.edu.cn/debian bullseye-updates main non-free contrib
deb http://mirrors.ustc.edu.cn/debian bullseye-proposed-updates main non-free contrib
deb http://mirrors.ustc.edu.cn/debian bullseye-backports main non-free contrib
deb http://mirrors.ustc.edu.cn/debian bullseye-backports-sloppy main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian bullseye main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian bullseye-updates main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian bullseye-proposed-updates main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian bullseye-backports main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian bullseye-backports-sloppy main non-free contrib
# 中科大安全更新镜像源
deb http://mirrors.ustc.edu.cn/debian-security bullseye-security main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian-security bullseye-security main non-free contrib
⑤ 官方镜像
对于位于国外的服务器,推荐使用官方的镜像。
# 官方软件源
deb http://deb.debian.org/debian bullseye main non-free contrib
deb http://deb.debian.org/debian bullseye-updates main non-free contrib
deb http://deb.debian.org/debian bullseye-proposed-updates main non-free contrib
deb http://deb.debian.org/debian bullseye-backports main non-free contrib
deb http://deb.debian.org/debian bullseye-backports-sloppy main non-free contrib
deb-src http://deb.debian.org/debian bullseye main non-free contrib
deb-src http://deb.debian.org/debian bullseye-updates main non-free contrib
deb-src http://deb.debian.org/debian bullseye-proposed-updates main non-free contrib
deb-src http://deb.debian.org/debian bullseye-backports main non-free contrib
deb-src http://deb.debian.org/debian bullseye-backports-sloppy main non-free contrib
# 官方安全更新源
deb http://deb.debian.org/debian-security bullseye-security main non-free contrib
deb-src http://deb.debian.org/debian-security bullseye-security main non-free contrib
(2) Deepin
Deepin没有特殊情况就建议使用自带的官方镜像源。
1. 20.x - apricot
① 官方
# 官方镜像源
deb https://community-packages.deepin.com/deepin apricot main contrib non-free
deb-src https://community-packages.deepin.com/deepin apricot main contrib non-free
② 阿里云
# 阿里镜像站
deb https://mirrors.aliyun.com/deepin apricot main contrib non-free
deb-src https://mirrors.aliyun.com/deepin apricot main contrib non-free
③ 腾讯云
# 腾讯镜像站
deb https://mirrors.cloud.tencent.com/deepin apricot main contrib non-free
deb-src https://mirrors.cloud.tencent.com/deepin apricot main contrib non-free
④ 清华大学镜像站
# 清华大学镜像站
deb https://mirror.tuna.tsinghua.edu.cn/deepin apricot main contrib non-free
deb-src https://mirror.tuna.tsinghua.edu.cn/deepin apricot main contrib non-free
⑤ 中科大镜像站
# 中科大镜像站
deb http://mirrors.ustc.edu.cn/deepin apricot main contrib non-free
deb-src http://mirrors.ustc.edu.cn/deepin apricot main contrib non-free
(3) Ubuntu
1. 22.04.1 LTS - jammy
① 阿里云
# 阿里镜像站
deb https://mirrors.aliyun.com/ubuntu jammy main multiverse restricted universe
deb https://mirrors.aliyun.com/ubuntu jammy-backports main multiverse restricted universe
deb https://mirrors.aliyun.com/ubuntu jammy-proposed main multiverse restricted universe
deb https://mirrors.aliyun.com/ubuntu jammy-security main multiverse restricted universe
deb https://mirrors.aliyun.com/ubuntu jammy-updates main multiverse restricted universe
deb-src https://mirrors.aliyun.com/ubuntu jammy main multiverse restricted universe
deb-src https://mirrors.aliyun.com/ubuntu jammy-backports main multiverse restricted universe
deb-src https://mirrors.aliyun.com/ubuntu jammy-proposed main multiverse restricted universe
deb-src https://mirrors.aliyun.com/ubuntu jammy-security main multiverse restricted universe
deb-src https://mirrors.aliyun.com/ubuntu jammy-updates main multiverse restricted universe
② 腾讯云
# 腾讯镜像站
deb https://mirrors.cloud.tencent.com/ubuntu jammy main multiverse restricted universe
deb https://mirrors.cloud.tencent.com/ubuntu jammy-backports main multiverse restricted universe
deb https://mirrors.cloud.tencent.com/ubuntu jammy-proposed main multiverse restricted universe
deb https://mirrors.cloud.tencent.com/ubuntu jammy-security main multiverse restricted universe
deb https://mirrors.cloud.tencent.com/ubuntu jammy-updates main multiverse restricted universe
deb-src https://mirrors.cloud.tencent.com/ubuntu jammy main multiverse restricted universe
deb-src https://mirrors.cloud.tencent.com/ubuntu jammy-backports main multiverse restricted universe
deb-src https://mirrors.cloud.tencent.com/ubuntu jammy-proposed main multiverse restricted universe
deb-src https://mirrors.cloud.tencent.com/ubuntu jammy-security main multiverse restricted universe
deb-src https://mirrors.cloud.tencent.com/ubuntu jammy-updates main multiverse restricted universe
③ 清华大学镜像站
# 清华大学镜像站
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy main multiverse restricted universe
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-backports main multiverse restricted universe
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-proposed main multiverse restricted universe
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-security main multiverse restricted universe
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-updates main multiverse restricted universe
deb-src https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy main multiverse restricted universe
deb-src https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-backports main multiverse restricted universe
deb-src https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-proposed main multiverse restricted universe
deb-src https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-security main multiverse restricted universe
deb-src https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-updates main multiverse restricted universe
④ 中科大镜像站
# 中科大镜像站
deb https://mirrors.ustc.edu.cn/ubuntu jammy main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu jammy-backports main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu jammy-proposed main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu jammy-security main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu jammy-updates main multiverse restricted universe
deb-src https://mirrors.ustc.edu.cn/ubuntu jammy main multiverse restricted universe
deb-src https://mirrors.ustc.edu.cn/ubuntu jammy-backports main multiverse restricted universe
deb-src https://mirrors.ustc.edu.cn/ubuntu jammy-proposed main multiverse restricted universe
deb-src https://mirrors.ustc.edu.cn/ubuntu jammy-security main multiverse restricted universe
deb-src https://mirrors.ustc.edu.cn/ubuntu jammy-updates main multiverse restricted universe
(4) LinuxMint
在这里需要说明一下:Linux Mint的软件源配置和其它系统稍有不同,需要同时修改/etc/apt/sources.list
和/etc/apt/sources.list.d/official-package-repositories.list
这两个文件,首先可以将两个文件内容都清空或者全部注释掉,然后选择下列任意一个镜像站的对应配置内容粘贴进去。
1. 21 - vanessa
① 阿里云
/etc/apt/sources.list
内容:
# 阿里镜像站
deb https://mirrors.aliyun.com/linuxmint-packages vanessa backport import main multiverse romeo universe upstream
deb-src https://mirrors.aliyun.com/linuxmint-packages vanessa backport import main multiverse romeo universe upstream
/etc/apt/sources.list.d/official-package-repositories.list
内容:
# 阿里镜像站
deb https://mirrors.aliyun.com/ubuntu jammy main multiverse restricted universe
deb https://mirrors.aliyun.com/ubuntu jammy-backports main multiverse restricted universe
deb https://mirrors.aliyun.com/ubuntu jammy-proposed main multiverse restricted universe
deb https://mirrors.aliyun.com/ubuntu jammy-security main multiverse restricted universe
deb https://mirrors.aliyun.com/ubuntu jammy-updates main multiverse restricted universe
deb-src https://mirrors.aliyun.com/ubuntu jammy main multiverse restricted universe
deb-src https://mirrors.aliyun.com/ubuntu jammy-backports main multiverse restricted universe
deb-src https://mirrors.aliyun.com/ubuntu jammy-proposed main multiverse restricted universe
deb-src https://mirrors.aliyun.com/ubuntu jammy-security main multiverse restricted universe
deb-src https://mirrors.aliyun.com/ubuntu jammy-updates main multiverse restricted universe
② 腾讯云
/etc/apt/sources.list
内容:
# 腾讯镜像站
deb https://mirrors.cloud.tencent.com/linuxmint vanessa backport import main multiverse romeo universe upstream
deb-src https://mirrors.cloud.tencent.com/linuxmint vanessa backport import main multiverse romeo universe upstream
/etc/apt/sources.list.d/official-package-repositories.list
内容:
# 腾讯镜像站
deb https://mirrors.cloud.tencent.com/ubuntu jammy main multiverse restricted universe
deb https://mirrors.cloud.tencent.com/ubuntu jammy-backports main multiverse restricted universe
deb https://mirrors.cloud.tencent.com/ubuntu jammy-proposed main multiverse restricted universe
deb https://mirrors.cloud.tencent.com/ubuntu jammy-security main multiverse restricted universe
deb https://mirrors.cloud.tencent.com/ubuntu jammy-updates main multiverse restricted universe
deb-src https://mirrors.cloud.tencent.com/ubuntu jammy main multiverse restricted universe
deb-src https://mirrors.cloud.tencent.com/ubuntu jammy-backports main multiverse restricted universe
deb-src https://mirrors.cloud.tencent.com/ubuntu jammy-proposed main multiverse restricted universe
deb-src https://mirrors.cloud.tencent.com/ubuntu jammy-security main multiverse restricted universe
deb-src https://mirrors.cloud.tencent.com/ubuntu jammy-updates main multiverse restricted universe
③ 清华大学镜像站
/etc/apt/sources.list
内容:
# 清华大学镜像站
deb https://mirror.tuna.tsinghua.edu.cn/linuxmint vanessa backport import main multiverse romeo universe upstream
deb-src https://mirror.tuna.tsinghua.edu.cn/linuxmint vanessa backport import main multiverse romeo universe upstream
/etc/apt/sources.list.d/official-package-repositories.list
内容:
# 清华大学镜像站
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy main multiverse restricted universe
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-backports main multiverse restricted universe
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-proposed main multiverse restricted universe
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-security main multiverse restricted universe
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-updates main multiverse restricted universe
deb-src https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy main multiverse restricted universe
deb-src https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-backports main multiverse restricted universe
deb-src https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-proposed main multiverse restricted universe
deb-src https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-security main multiverse restricted universe
deb-src https://mirror.tuna.tsinghua.edu.cn/ubuntu jammy-updates main multiverse restricted universe
④ 中科大
/etc/apt/sources.list
内容:
# 中科大镜像站
deb http://mirrors.ustc.edu.cn/linuxmint vanessa backport import main multiverse romeo universe upstream
deb-src http://mirrors.ustc.edu.cn/linuxmint vanessa backport import main multiverse romeo universe upstream
/etc/apt/sources.list.d/official-package-repositories.list
内容:
# 中科大镜像站
deb https://mirrors.ustc.edu.cn/ubuntu jammy main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu jammy-backports main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu jammy-proposed main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu jammy-security main multiverse restricted universe
deb https://mirrors.ustc.edu.cn/ubuntu jammy-updates main multiverse restricted universe
deb-src https://mirrors.ustc.edu.cn/ubuntu jammy main multiverse restricted universe
deb-src https://mirrors.ustc.edu.cn/ubuntu jammy-backports main multiverse restricted universe
deb-src https://mirrors.ustc.edu.cn/ubuntu jammy-proposed main multiverse restricted universe
deb-src https://mirrors.ustc.edu.cn/ubuntu jammy-security main multiverse restricted universe
deb-src https://mirrors.ustc.edu.cn/ubuntu jammy-updates main multiverse restricted universe
(5) Kali
1. 2022.x - kali-rolling
① 阿里云
# 阿里镜像站
deb https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
② 腾讯云
# 腾讯镜像站
deb https://mirrors.cloud.tencent.com/kali kali-rolling main non-free contrib
deb-src https://mirrors.cloud.tencent.com/kali kali-rolling main non-free contrib
③ 清华大学镜像站
# 清华大学镜像站
deb https://mirror.tuna.tsinghua.edu.cn/kali kali-rolling main non-free contrib
deb-src https://mirror.tuna.tsinghua.edu.cn/kali kali-rolling main non-free contrib
④ 中科大镜像站
# 中科大镜像站
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
记得要以管理员身份才能编辑该文件!保存后执行命令sudo apt update
以更新索引!
3,软件源更新问题
如果新安装的Linux,在根据上述操作配置软件源后,执行sudo apt update
时报错如下:
这是由于系统缺少软件包ca-certificates
导致。
解决办法是,先编辑软件源配置/etc/apt/sources.list
文件,将其中所有的地址前面的https
改成http
,再执行下列命令:
sudo apt update
sudo apt install ca-certificates
然后,再把/etc/apt/sources.list
文件中的所有的地址前面的http
重新改回https
,并再次执行sudo apt update
即可!
4,更新系统
如果你现在使用的是Debian 11的版本,想更新到Debian 12版本,并不需要重装系统,只需要将你的软件源配置文件sources.list
中的内容换成Debian 12的软件源配置,再执行更新命令即可!
替换完成内容后,执行下列命令完成系统更新:
sudo apt update
sudo apt full-upgrade
sudo apt autoremove
sudo apt clean
最后重启系统。
参考: