在 Debian 及其衍生发行版(如 Ubuntu) 中,本身默认是不使用 yum 的,而是使用 apt。下面从概念、来源、使用场景等方面说明它们的区别:
| 项目 | apt | yum |
|---|---|---|
| 全称 | Advanced Package Tool | Yellowdog Updater, Modified |
| 所属发行版 | Debian / Ubuntu / Kali 等 | RHEL / CentOS / Fedora(旧版)等 |
| 软件包格式 | .deb |
.rpm |
| 后端工具 | dpkg | rpm |
| 当前状态 | 主流、活跃维护 | CentOS 7 及以前常用,已被 dnf 取代 |
✅ Debian 正确的包管理方式是 apt / apt-get / dpkg
| 功能 | apt(Debian) | yum(RHEL/CentOS) |
|---|---|---|
| 更新软件源 | apt update |
yum makecache |
| 安装软件 | apt install nginx |
yum install nginx |
| 卸载软件 | apt remove nginx |
yum remove nginx |
| 搜索软件 | apt search nginx |
yum search nginx |
| 查看信息 | apt show nginx |
yum info nginx |
| 升级系统 | apt upgrade |
yum update |
apt(推荐,用户友好)apt-get(脚本中更稳定)yum 已被 dnf 取代pacmanzypperDebian 用 apt,RHEL/CentOS 用 yum(或 dnf)。
在 Debian 上不需要、也不应该使用 yum。
如果你愿意,我也可以帮你写一份 Debian apt 常用命令速查表,或者解释 apt 和 apt-get 的区别。