正德厚生,臻于至善

linux查找某个命令属于哪个rpm包

我们拿ssh-copy-id命令来举例

方法一:
确认命令的路径
# which ssh-copy-id     
/bin/ssh-copy-id

用yum命令查找ssh-copy-id属于哪个rpm包
# yum whatprovides /bin/ssh-copy-id
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
openssh-clients-7.4p1-21.el7.x86_64 : An open source SSH client applications
Repo        : @base
Matched from:
Filename    : /bin/ssh-copy-id

根据上述信息,可知ssh-copy-id来自openssh-clients-7.4p1-21.el7.x86_64这个包.

另外yum provides/whatprovides接受通配符选项:
假如不知道命令的路径,也可以用通配来解决
yum whatprovides *ssh-copy-id
关于yum的其它用法可以man yum查看

方法二:
确认命令的路径
# whereis ssh-copy-id
ssh-copy-id: /usr/bin/ssh-copy-id /usr/share/man/man1/ssh-copy-id.1.gz

查找命令属于那个安装包
# rpm -qf /usr/bin/ssh-copy-id   
openssh-clients-7.4p1-21.el7.x86_64

列出这个rpm包中的所有文件
# rpm -ql openssh-clients-7.4p1-21.el7.x86_64
查询是否安装某个rpm包.
# rpm -qa|grep openssh-clients
赞(0) 打赏
未经允许不得转载:徐万新之路 » linux查找某个命令属于哪个rpm包

支持快讯、专题、百度收录推送、人机验证、多级分类筛选器,适用于垂直站点、科技博客、个人站,扁平化设计、简洁白色、超多功能配置、会员中心、直达链接、文章图片弹窗、自动缩略图等...

联系我们

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

登录

找回密码

注册