在 Debian 及其衍生发行版(Ubuntu 等)中,默认并不使用 yum,而是使用 APT 包管理系统。
所以 没有 yum 仓库列表,只有 APT 软件源。
下面分情况说明:
cat /etc/apt/sources.list
/etc/apt/sources.list.d/ 目录下的额外源ls /etc/apt/sources.list.d/
cat /etc/apt/sources.list.d/*.list
apt-cache policy
或查看某个软件来源:
apt-cache policy nginx
某些特殊场景(如兼容 CentOS 软件)可能安装了 yum,但仍然不建议。
yum repolist
或查看所有仓库(包括禁用):
yum repolist all
⚠️ 注意:
apt / dpkg| 功能 | Debian / Ubuntu | CentOS / RHEL |
|---|---|---|
| 包管理 | apt / dpkg | yum / dnf / rpm |
| 仓库配置 | /etc/apt/sources.list |
/etc/yum.repos.d/*.repo |
| 查看仓库 | apt-cache policy |
yum repolist |
如果你是 Debian 用户,正确命令是:
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d/
apt-cache policy
如果你愿意,可以贴出你的系统版本,我可以帮你分析当前源是否配置正确。