Debian系Linux软件源配置详解与常用的国内软件源汇总

简介: Debian系Linux软件源配置详解与常用的国内软件源汇总

在安装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

image.png

(1) 版本代号/水平划分部分

在上述紧接着配置的地址后的bullseye就表示该系统版本代号,当前系统版本代号可以通过命令lsb_release -a查看,输出结果中的Codename就是当前系统版本代号。

image.png

若提示找不到lsb_release命令,则通过以下命令安装lsb-release包:

sudo apt install lsb-release

知道了当前系统版本代号之后,我们可以先在浏览器打开镜像源地址,打开后通常是目录形式,在里面我们可以找到所有软件包:

image.png

进入其中的dists文件夹,在里面可以看到所有的系统代号(这个目录中存放的是每个系统代号对应的软件列表索引):

image.png

我们这里Debian 11的代号是bullseye,因此我们可以先在这找到bullseye代号及其相关部分

image.png

可见包含该系统代号的主要软件包及其水平划分一共有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文件夹(这个文件夹就存放的是所有软件包):

image.png

image.png

可见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目录中的对应的系统代号部分查看:

image.png

进入dist中对应代号的目录,查看其中的目录名即可(文件不管)。

可见Debian发行版的系统代号下的软件包划分是和pool中的是对应的,如果说不对应则以dist中每个代号中的垂直划分为准

Debian除了配置上述主要软件源以外,还有安全更新源,下面会贴出。

其余系统的系统代号部分和软件包划分可能有所不同,例如Ubuntu源中,distspool中如下:

image.png

image.png

可见Ubuntu和Debian不同,软件包划分为四个分支,意义也不一样,具体大家可以自行了解。

对于Deepin就很简单了,其没有水平划分

image.png

可见即使是不同的系统,软件源配置方式及其划分方式都是几乎一样的,总结而来如下:

  • 水平划分:每个Linux系统的某个版本都有其对应的代号,而该代号版本的系统的所有软件包通常会先按照功能水平划分,例如Debian的bullseye代号下所有软件包先被水平划分为了5个类别:bullseyebullseye-updatesbullseye-proposed-updatesbullseye-backportsbullseye-backports-sloppy水平划分部分可以在软件源网址中的dists目录中看到,当然不是每个系统的软件包都会水平划分,例如Deepin 20的软件包就没有进行水平划分,那么就直接在dists中找到其版本代号即可
  • 垂直划分:每个水平划分下的软件包通常又会根据软件包自由程度进行垂直划分,而通常一个系统中的每个水平划分下的垂直划分都是一样的。例如Debian中每个水平划分下都垂直划分为了3类:maincontribnon-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时报错如下:

image.png

这是由于系统缺少软件包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

最后重启系统。

参考:

相关实践学习
2分钟自动化部署人生模拟器
本场景将带你借助云效流水线Flow实现人生模拟器小游戏的自动化部署
7天玩转云服务器
云服务器ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,可降低 IT 成本,提升运维效率。本课程手把手带你了解ECS、掌握基本操作、动手实操快照管理、镜像管理等。了解产品详情: https://www.aliyun.com/product/ecs
相关文章
|
9天前
|
缓存 资源调度 安全
深入探索Linux操作系统的心脏——内核配置与优化####
本文作为一篇技术性深度解析文章,旨在引领读者踏上一场揭秘Linux内核配置与优化的奇妙之旅。不同于传统的摘要概述,本文将以实战为导向,直接跳入核心内容,探讨如何通过精细调整内核参数来提升系统性能、增强安全性及实现资源高效利用。从基础概念到高级技巧,逐步揭示那些隐藏在命令行背后的强大功能,为系统管理员和高级用户打开一扇通往极致性能与定制化体验的大门。 --- ###
32 9
|
11天前
|
存储 安全 数据管理
如何在 Rocky Linux 8 上安装和配置 Elasticsearch
本文详细介绍了在 Rocky Linux 8 上安装和配置 Elasticsearch 的步骤,包括添加仓库、安装 Elasticsearch、配置文件修改、设置内存和文件描述符、启动和验证 Elasticsearch,以及常见问题的解决方法。通过这些步骤,你可以快速搭建起这个强大的分布式搜索和分析引擎。
29 5
|
12天前
|
Ubuntu Shell 开发工具
ubuntu/debian shell 脚本自动配置 gitea git 仓库
这是一个自动配置 Gitea Git 仓库的 Shell 脚本,支持 Ubuntu 20+ 和 Debian 12+ 系统。脚本会创建必要的目录、下载并安装 Gitea,创建 Gitea 用户和服务,确保 Gitea 在系统启动时自动运行。用户可以选择从官方或小绿叶技术博客下载安装包。
33 2
|
1月前
|
存储 安全 Linux
|
25天前
|
Java Linux 网络安全
NIFI在Linux服务区上的部署配置过程是什么?
【10月更文挑战第21天】NIFI在Linux服务区上的部署配置过程是什么?
41 2
|
1月前
|
Ubuntu Linux 编译器
Linux/Ubuntu下使用VS Code配置C/C++项目环境调用OpenCV
通过以上步骤,您已经成功在Ubuntu系统下的VS Code中配置了C/C++项目环境,并能够调用OpenCV库进行开发。请确保每一步都按照您的系统实际情况进行适当调整。
281 3
|
1月前
|
监控 安全 网络协议
快速配置Linux云服务器
【10月更文挑战第3天】快速配置Linux云服务器
|
1月前
|
应用服务中间件 Linux Shell
Linux 配置 Nginx 服务的详细步骤,绝对干货
Linux 配置 Nginx 服务的详细步骤,绝对干货
72 0
|
Unix Linux 测试技术
中科院发布国产 RISC-V 处理器“香山”:已成功运行 Linux/Debian
中科院发布国产 RISC-V 处理器“香山”:已成功运行 Linux/Debian
616 0
中科院发布国产 RISC-V 处理器“香山”:已成功运行 Linux/Debian
|
7天前
|
Linux
在 Linux 系统中,“cd”命令用于切换当前工作目录
在 Linux 系统中,“cd”命令用于切换当前工作目录。本文详细介绍了“cd”命令的基本用法和常见技巧,包括使用“.”、“..”、“~”、绝对路径和相对路径,以及快速切换到上一次工作目录等。此外,还探讨了高级技巧,如使用通配符、结合其他命令、在脚本中使用,以及实际应用案例,帮助读者提高工作效率。
31 3