温馨提示×

debian fetchdebian慢咋办

小樊
39
2026-10-17 04:31:18
栏目: 智能运维

在 Debian 下 apt / fetchDebian 下载慢,通常是镜像源太远或被墙/限速导致的。可以按下面思路解决:


一、换成国内镜像源(最有效)

1. 备份原源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2. 编辑源文件

sudo nano /etc/apt/sources.list

3. 使用国内镜像(任选一个)

清华大学

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

中科大

deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security bookworm-security main contrib non-free

注意:把 bookworm 换成你的版本(如 bullseye)

4. 更新

sudo apt update
sudo apt upgrade

二、使用 apt-fast(多线程下载)

sudo apt install apt-fast

之后用:

sudo apt-fast update
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

四、其他优化

  • 换 DNS(如 223.5.5.5)
  • 用 apt-get 代替图形工具
  • 避免在高峰时段更新

如果你能说一下:

  • Debian 版本
  • 是国内还是国外服务器
  • 用的是 apt 还是 fetchDebian 工具

我可以给你更精确的配置。

0 踩