转自:https://blog.youkuaiyun.com/qq_26507799/article/details/78998439
Debian:(Ubuntu等)
先安装apt-file
- sudo apt-get install -y apt-file
- apt-file update
- root@debian ~ # apt-file search bin/ifconfig
- net-tools: /bin/ifconfig
apt-file search -x(--regexp) 后可接正则表达式,如:
- root@deepin ~ # apt-file search -x 'bin/rz$'
- lrzsz: /usr/bin/rz
- root@deepin ~ # apt-file search --regexp 'bin/rz$'
- lrzsz: /usr/bin/rz
CentOS:
- root@CentOS7 ~ # yum provides *bin/ifconfig
- Loaded plugins: fastestmirror
- Loading mirror speeds from cached hostfile
- * base: mirrors.shuosc.org
- * extras: mirrors.shuosc.org
- * updates: mirrors.163.com
- net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
- Repo : base
- Matched from:
- Filename : /sbin/ifconfig
- net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
- Repo : @base
- Matched from:
- Filename : /sbin/ifconfig
本文介绍如何在Debian(包括Ubuntu)及CentOS系统中使用apt-file和yum provides命令查询软件包信息。对于Debian系统,首先需安装并更新apt-file工具,然后可通过搜索特定命令来定位其所属的软件包。CentOS用户则直接利用yum provides命令进行搜索。
7万+

被折叠的 条评论
为什么被折叠?



