查找命令属于哪个包

方式1

[root@yangzaigang ~]# rpm -qf `which java`
文件 /usr/bin/java 不属于任何软件包
[root@yangzaigang ~]# 
[root@yangzaigang ~]# 
[root@yangzaigang ~]# rpm -qf `which ip`
iproute-4.11.0-30.el7.x86_64

方式2

[root@yangzaigang ~]# yum provides ip
已加载插件: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
 * base: mirrors.cloud.aliyuncs.com
 * extras: mirrors.cloud.aliyuncs.com
 * updates: mirrors.cloud.aliyuncs.com
docker-ce-stable/7/x86_64/filelists_db                                                                                                                                  |  28 kB  00:00:00     
epel/x86_64/filelists_db                                                                                                                                                |  12 MB  00:00:00     
kubernetes/filelists                                                                                                                                                    |  33 kB  00:00:00     
updates/7/x86_64/filelists_db                                                                                                                                           | 6.5 MB  00:00:00     
iproute-4.11.0-30.el7.x86_64 : Advanced IP routing and network device configuration tools
源    :base
匹配来源:
文件名    :/usr/sbin/ip



iproute-4.11.0-30.el7.x86_64 : Advanced IP routing and network device configuration tools
源    :@anaconda
匹配来源:
文件名    :/usr/sbin/ip
posted @ 2021-10-29 22:47  1769987233  阅读(52)  评论(0编辑  收藏  举报