在 Debian 系统里,不使用 yum,而是使用 apt / apt-get,对应的“仓库”配置文件在:
主配置文件:
/etc/apt/sources.list
附加仓库目录(推荐):
/etc/apt/sources.list.d/
这个目录下通常是 .list 文件,比如:
/etc/apt/sources.list.d/docker.list
编辑文件(需要 root 权限):
sudo nano /etc/apt/sources.list
或修改 sources.list.d/ 下的文件。
示例(Debian 12 bookworm):
deb http://deb.debian.org/debian bookworm main
deb http://deb.debian.org/debian bookworm-updates main
deb http://security.debian.org/debian-security bookworm-security main
sudo apt update
/etc/yum.repos.d/
如果你是 把 CentOS 的思维带到 Debian,记住一句话:
Debian 没有 yum,仓库在
/etc/apt/sources.list和/etc/apt/sources.list.d/
如果你是想 在 Debian 上用 yum(不推荐) 或 配置某个特定软件源,可以告诉我具体场景。