正德厚生,臻于至善

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包

评论 抢沙发

联系我们

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

支付宝扫一扫

微信扫一扫

登录

找回密码

注册