centos查看一个命令应该安装哪个包

有时候缺少命令,但是又不知道安装哪个包,可以使用如下进行查找

dnf -q provides '*/vim'
yum provides '*/vim'

这两个命令效果一样

比如我们需要安装vim,那么可以查询一下,得到如下结果

vim-common-2:8.0.1763-15.el8.x86_64 : The common files needed by any version of the VIM editor
Repo        : AppStream
Matched from:
Filename    : /usr/share/vim

vim-common-2:8.0.1763-16.el8.x86_64 : The common files needed by any version of the VIM editor
Repo        : @System
Matched from:
Filename    : /usr/share/vim

vim-common-2:8.0.1763-16.el8.x86_64 : The common files needed by any version of the VIM editor
Repo        : appstream
Matched from:
Filename    : /usr/share/vim

vim-enhanced-2:8.0.1763-15.el8.x86_64 : A version of the VIM editor which includes recent enhancements
Repo        : AppStream
Matched from:
Filename    : /usr/bin/vim

vim-enhanced-2:8.0.1763-16.el8.x86_64 : A version of the VIM editor which includes recent enhancements
Repo        : @System
Matched from:
Filename    : /usr/bin/vim

vim-enhanced-2:8.0.1763-16.el8.x86_64 : A version of the VIM editor which includes recent enhancements
Repo        : appstream
Matched from:
Filename    : /usr/bin/vim

上面列出了可以安装的包vim-common vim-enhanced都可以安装得到vim

上面语句的意思就是查找提供安装路径为*/vim的包,这是一个通配符,与上面的Filename匹配

posted @   秋来叶黄  阅读(305)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
历史上的今天:
2020-08-10 编译opencv和opencv_contrib
点击右上角即可分享
微信分享提示