在 Debian 里所谓 fetchdebian 慢,通常指用 apt / apt-get 从 Debian 源下载软件很慢。可以按下面几步排查和优化。
Debian 默认源在国外,国内访问很慢。
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo nano /etc/apt/sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free
把
bookworm换成你的版本(如bullseye)
sudo apt update
apt-fast(多线程下载)apt-fast 用 aria2 多线程下载,速度快很多。
sudo apt install aria2
sudo apt install apt-fast
使用方式不变:
sudo apt-fast install xxx
ping mirrors.tuna.tsinghua.edu.cn
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
sudo -E apt update
non-free / backports(如不需要)apt install 慢如果你愿意,可以告诉我:
我可以给你最优源 + 命令一键配置。