在Debian输入cat /etc/os-release
查看当前Debian系统的版本
$ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux"VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=debian HOME_URL=" SUPPORT_URL=" BUG_REPORT_URL="https://bugs.debian.org/"
此处是Debian GNU/Linux 10 (buster)
在清华源找到对应的软件源镜像
可以直接点击Debian右侧的❓进入Debian镜像使用帮助
如图也可以在清华源镜像站右下角找到使用帮助 然后再找到Debian的使用帮助

备份并更换清华源
使用命令sudo mv /etc/apt/sources.list /etc/apt/sources.list.back
将/etc/apt/sources.list
重命名为/etc/apt/sources.list.back
实现备份
$ mv /etc/apt/sources.list /etc/apt/sources.list.back
sudo nano /etc/apt/sources.list
写入清华源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
进行update更新 发现报错
$ sudo apt update Ign:1 https://mirrors.tuna.tsinghua.edu.cn/debian buster InRelease Ign:2 https://mirrors.tuna.tsinghua.edu.cn/debian buster-updates InRelease Ign:3 https://mirrors.tuna.tsinghua.edu.cn/debian buster-backports InRelease Ign:4 https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates InRelease Err:5 https://mirrors.tuna.tsinghua.edu.cn/debian buster Release Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 101.6.8.193 443]... E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
可以在清华源Debian使用帮助中发现
如果遇到无法拉取 https 源的情况,请先使用 http 源并安装: $ sudo apt install apt-transport-https ca-certificates
这里直接将/etc/apt/sources.list
中的https改为http,然后先sudo apt update
再使用执行清华源Debian使用帮助中的命令,再改回https即可