在 Debian 系统中,yum 命令无效是正常现象,原因如下:
yum 是 Red Hat 系列(如 CentOS、RHEL、Fedora 旧版)的包管理工具apt / apt-getdpkg所以你在 Debian 上执行 yum 会提示:
command not found
常用示例如下:
# 更新软件源
sudo apt update
# 安装软件
sudo apt install nginx
# 卸载软件
sudo apt remove nginx
# 搜索软件
apt search vim
# 查看已安装包
dpkg -l
只有在以下情况才需要:
查看系统类型:
cat /etc/os-release
| 系统 | 包管理器 |
|---|---|
| Debian / Ubuntu | apt |
| CentOS 6/7 | yum |
| CentOS 8+ | dnf |
| Arch | pacman |
✅ 结论:
Debian 上
yum无效是正常的,请使用apt。
如果你愿意,可以告诉我你想安装什么软件,我可以直接给你 Debian 下的命令。