温馨提示×

debian怎么配置fetchdebian源

小樊
36
2026-09-20 19:31:23
栏目: 智能运维

在 Debian 里“fetchdebian 源”一般有两种常见理解,我先分别说明,你按需取用。


一、如果你说的是 配置 Debian 官方镜像源(apt source)

这是最常见的需求,用于 apt update / apt install。

1. 备份原源

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

2. 编辑源文件

sudo nano /etc/apt/sources.list

3. 使用官方或国内镜像(示例)

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
deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware

4. 更新

sudo apt update

二、如果你说的是 fetchdeb / fetch-debian 工具

目前 Debian 官方并没有叫 fetchdebian 的标准命令,可能是:

1. 想“下载 deb 包但不安装”

apt download 包名

或

sudo apt-get install --download-only 包名

2. 想用 apt-get 指定源拉包

apt-get install -y --allow-downgrades 包名

3. 如果是某个第三方工具(如 fetchdeb)

请确认工具名,我可以给你具体配置方法。


三、快速判断你当前 Debian 版本

cat /etc/os-release

或

lsb_release -a

如果你能补充一下:

  • Debian 版本(如 11 / 12)
  • 是否是 国内服务器
  • 你说的 “fetchdebian” 是工具名还是“获取 deb 源”的意思

我可以直接给你一份 可直接复制用的 sources.list。

0 踩