1.yum查询软件属于哪个包
[root@cloudecker ~]#yum whatprovides ‘ifconfig’
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
- base: mirrors.aliyun.com
- extras: mirrors.aliyun.com
- updates: mirrors.aliyun.com
net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo : @anaconda
Matched from:
Filename : /usr/sbin/ifconfig
2.rpm查询软件属于哪个包
which
rpm -qf
[root@cloudecker ~]#which ifconfig
/usr/sbin/ifconfig
[root@cloudecker ~]#rpm -qf /usr/sbin/ifconfig
net-tools-2.0-0.22.20131004git.el7.x86_64
Debian:(Ubuntu等)
先安装apt-file
sudo apt-get install -y apt-file
apt-file update
查询命令:(已查询ifconfig为例)
root@debian ~ # apt-file search bin/ifconfig
net-tools: /bin/ifconfig
apt-file search -x(–regexp) 后可接正则表达式,如:
root@deepin ~ # apt-file search -x ‘bin/rzKaTeX parse error: Expected ‘EOF’, got ‘#’ at position 36: … root@deepin ~ #̲ apt-file searc…’
lrzsz: /usr/bin/rz