在 Debian 系统中,不使用 yum,而是使用 APT 作为包管理工具。
所以 没有 yum 仓库,只有 APT 软件源。
APT 的仓库配置文件主要在以下位置:
/etc/apt/sources.list
查看内容:
cat /etc/apt/sources.list
示例(Debian 11 bullseye):
deb http://deb.debian.org/debian bullseye main
deb http://security.debian.org/debian-security bullseye-security main
deb http://deb.debian.org/debian bullseye-updates main
/etc/apt/sources.list.d/
查看所有仓库文件:
ls /etc/apt/sources.list.d/
cat /etc/apt/sources.list.d/*.list
很多第三方软件(如 Docker、Nginx、MySQL)会在这里添加 .list 文件。
apt-cache policy
或更详细:
apt-cache policy 包名
sudo apt update
更新时会显示所有正在使用的仓库地址。
| 系统 | 包管理器 | 仓库配置 |
|---|---|---|
| Debian / Ubuntu | apt | /etc/apt/sources.list |
| CentOS / RHEL | yum / dnf | /etc/yum.repos.d/ |
✅ Debian 没有 yum,也没有 /etc/yum.repos.d/
如果你是在 Debian 上 想用 yum(不推荐),那通常是:
可以确认系统版本:
cat /etc/os-release
如果你愿意,可以告诉我:
我可以直接给你对应的配置示例。