你提到的 “fetchdebian” 可能有几种不同含义,下面我分别说明,你可以对照自己的需求选择。
这是最常见的情况,fetchdebian ≈ 配置 apt 源并下载软件。
编辑源列表文件:
sudo nano /etc/apt/sources.list
典型 Debian 12(bookworm)示例:
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
国内镜像示例(清华):
deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm main contrib non-free non-free-firmware
保存后更新:
sudo apt update
sudo apt install 包名
只下载不安装:
apt download 包名
下载并保留 deb 文件:
sudo apt-get install -d 包名
有些项目会用 fetchdebian 脚本来批量拉取 .deb 文件。
./fetchdeb.sh package_name
或:
fetchdebian --arch amd64 --suite bookworm nginx
⚠️ 如果你指的是某个具体项目里的 fetchdebian 脚本,请告诉我:
我可以给你精确配置方式。
用于制作最小 Debian 系统:
sudo apt install debootstrap
sudo debootstrap bookworm ./debian-root http://deb.debian.org/debian
sudo apt source 包名
需要先开启 source 源:
deb-src http://deb.debian.org/debian bookworm main
如果你能补充一句:
“我是在 ___ 场景下想用 fetchdebian”
我可以给你一步到位的配置命令。