合 linux下查找某个文件或者命令属于哪个软件包
linux下查看某个文件或者命令属于哪个软件包
centos/redhat下查看某个文件或命令属于哪个rpm包
可以使用rpm或者yum来查询:
1 2 3 4 5 6 7 8 | [root@test /]# which stress /usr/bin/stress [root@test /]# rpm -qf /usr/bin/stress stress-1.0.4-16.el7.x86_64 -- 或者 yum provides /etc/passwd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | -- 查询某个命令或者文件来自哪个软件包的方法 yum whatprovides "*platform-python*" yum whatprovides "*libpython3.6m.so*" yum whatprovides "libmp3lame.so.0()(64bit)" yum whatprovides "libspeex.so.1()(64bit)" -- 确认某个命令或服务来自哪个RPM包 yum provides XX yum provides "*/crond" yum provides nslookup yum provides showmount yum provides /etc/passwd -- showmount命令来自nfs-utils,通常一起安装yum -y install nfs-utils rpcbind |
ubuntu及衍生版:
1 2 3 | dpkg -S whereis sudo dpkg -S /usr/bin/whereis sudo dpkg-query -S /usr/bin/whereis |
过程: