在 Debian 系统中不使用 yum,yum 是 Red Hat / CentOS / Fedora 系列的包管理工具。
Debian 及其衍生版(如 Ubuntu)使用的是 APT 包管理系统,对应的配置文件位置如下:
/etc/apt/sources.list
/etc/apt/sources.list.d/
通常以
.list结尾,例如:
/etc/apt/sources.list.d/docker.list
/etc/apt/apt.conf.d/
用于配置代理、缓存、行为等,例如:
/etc/apt/apt.conf.d/95proxies
/etc/apt/trusted.gpg
/etc/apt/trusted.gpg.d/
/usr/share/keyrings/
sudo apt install yum
但 仅用于兼容某些脚本,不会真正管理 Debian 软件包。
/etc/yum.conf
/etc/yum.repos.d/
⚠️ 不建议在 Debian 上使用
| 功能 | Red Hat / CentOS | Debian / Ubuntu |
|---|---|---|
| 包管理 | yum / dnf | apt |
| 源配置 | /etc/yum.repos.d/ |
/etc/apt/sources.list |
| 安装 | yum install |
apt install |
| 更新 | yum update |
apt update && apt upgrade |
Debian 中没有 yum 配置文件;APT 的配置文件在
/etc/apt/目录下。
如果你是从 CentOS 转到 Debian,或者正在维护跨平台脚本,我可以帮你做 yum → apt 的对照转换。