在 Debian 上使用 HTTPS 软件源

Sep 02, 2025 • 预计阅读时间 1 分钟

Debian 的 APT 软件源默认使用 HTTP 协议进行传输,安全性是没有问题的。

但是如果使用 HTTPS 会让你更安心的话,只需要做以下调整就可以:

$ sudo apt install apt-transport-https ca-certificates

然后再把软件源中的仓库地址改成 HTTPS 协议:

$ sudo sed -i "s/http:\/\//https:\/\//g" /etc/apt/sources.list

最后更新一下软件源:

$ sudo apt update

Hit:1 https://deb.debian.org/debian trixie InRelease
Hit:2 https://deb.debian.org/debian-security trixie-security InRelease
Get:3 https://deb.debian.org/debian trixie-updates InRelease [47.1 kB]
Get:4 https://deb.debian.org/debian trixie-backports InRelease [53.7 kB]
Get:5 https://deb.debian.org/debian trixie-backports/main Sources.diff/Index [19.6 kB]
Get:6 https://deb.debian.org/debian trixie-backports/main amd64 Packages.diff/Index [15.1 kB]
Get:7 https://deb.debian.org/debian trixie-backports/main Sources T-2025-09-02-0814.39-F-2025-09-02-0814.39.pdiff [29 B]
Get:7 https://deb.debian.org/debian trixie-backports/main Sources T-2025-09-02-0814.39-F-2025-09-02-0814.39.pdiff [29 B]
Get:8 https://deb.debian.org/debian trixie-backports/main amd64 Packages T-2025-09-02-0814.39-F-2025-09-02-0814.39.pdiff [690 B]
Get:8 https://deb.debian.org/debian trixie-backports/main amd64 Packages T-2025-09-02-0814.39-F-2025-09-02-0814.39.pdiff [690 B]
Fetched 136 kB in 20s (6,660 B/s)
All packages are up to date.
Debian
版权声明:如果转发请带上本文链接和注明来源。

lvv.me

iOS/macOS Developer

IP 地址的压缩写法