通过 FetchDebian 加速 Debian 下载的实用方法
一 核心思路
二 安装与基本用法
sudo apt-get update && sudo apt-get install -y fetchdebianfetchdebian <package_name>fetchdebian <pkg1> <pkg2>,或使用通配符:fetchdebian '*'fetchdebian <package_name> -o /path/to/outputfetchdebian -s <package_name> / fetchdebian -b <package_name>fetchdebian -v <package_name>fetchdebian --cache-dirfetchdebian <package_name>=<version>fetchdebian <package_name> --no-depsfetchdebian <package_name> --proxy http://proxy.example.com:8080fetchdebian <package_name> --mirror http://mirror.example.com/debiansudo dpkg -i <file>.deb。三 提升下载速度的关键配置
--mirror 指定更快的镜像,例如:fetchdebian vim --mirror https://mirrors.ustc.edu.cn/debian/fetchdebian <package_name> --proxy http://127.0.0.1:7890/etc/environment 中添加
http_proxy="http://proxy_ip:port/"https_proxy="https://proxy_ip:port/"source /etc/environment/etc/apt/apt.conf 中添加
Acquire::http::Proxy "http://proxy_ip:port/";Acquire::https::Proxy "https://proxy_ip:port/";fetchdebian --cache-dir,在高速盘或内存盘上存放可进一步提速while read p; do fetchdebian "$p" --proxy "$PROXY" -v & done < pkg_list.txt-v 观察下载细节与所选镜像/代理apt-cache show <package_name> 核对版本与依赖信息四 常见问题与处理
-v 定位卡在的镜像或阶段--no-deps;安装 .deb 时可用 sudo apt-get -f install 补齐依赖--proxy 参数拼写与端口;环境变量需 source /etc/environment 重载;区分 APT 与 fetchdebian 的代理配置fetchdebian <package_name>=<version>,避免意外升级或解析到慢源