apt-cache - 显示未来的命令

apt-cache - 显示未来的命令

通过安装软件包后,有没有办法找出哪些命令可用apt-get

假设我想跑步apt-get -y net-tools

Host> apt-cache show net-tools
Package: net-tools
Version: 1.60-24.2
Installed-Size: 916
Maintainer: net-tools Team <[email protected]>
Architecture: amd64
Replaces: ja-trans (<= 0.8-2), netbase (<< 4.00)
Depends: libc6 (>= 2.4)
Conflicts: ja-trans (<= 0.8-2)
Description-en: The NET-3 networking toolkit
 This package includes the important tools for controlling the network
 subsystem of the Linux kernel.  This includes arp, ifconfig, netstat,
 rarp, nameif and route.  Additionally, this package contains utilities
 relating to particular network hardware types (plipconfig, slattach,
 mii-tool) and advanced aspects of IP configuration (iptunnel, ipmaddr).
 .
 In the upstream package 'hostname' and friends are included. Those are
 not installed by this package, since there is a special "hostname*.deb".
Homepage: http://net-tools.berlios.de/
Description-md5: 003fb6a11fdb767fff574478588a3ca8
Tag: admin::configuring, implemented-in::c, interface::commandline,
 network::configuration, network::routing, network::vpn, protocol::ipv6,
 role::program, scope::utility, use::routing
Section: net
Priority: important
Filename: pool/main/n/net-tools/net-tools_1.60-24.2_amd64.deb
Size: 346084
MD5sum: 7ef2fa3c53ba45adf9b3c369ef5ba458
SHA1: f8fa10c12f3309c69ed2a010e4824b6c41957c20
SHA256: a27cb96bc41b9349f6ab0a102cf8ed9210a129b2a67ca2a108675235d3600aaa

Host>

是否apt-cache show net-tools已经显示所有信息(arp、ifconfig、netstat、rarp、nameif、route、plipconfig、slattach、mii-tool、iptunnel、ipmaddr)?

答案1

apt-cache没有办法做到这一点。不过,apt-file会按照你的要求去做。联机帮助页:http://manpages.ubuntu.com/manpages/vivid/en/man1/apt-file.1.html

apt-file list net-tools即使未安装 net-tools,您也可以运行来列出 net-tools 安装的文件。

apt-file确实使用了此信息的缓存,您需要使用 定期更新该信息apt-file update

答案2

apt-file即使您尚未下载包,您也可以使用它来列出包中的所有文件。然后通过grep进行过滤。

$ apt-file list net-tools | grep bin
net-tools: /bin/netstat
net-tools: /sbin/ifconfig
net-tools: /sbin/ipmaddr
net-tools: /sbin/iptunnel
net-tools: /sbin/mii-tool
net-tools: /sbin/nameif
net-tools: /sbin/plipconfig
net-tools: /sbin/rarp
net-tools: /sbin/route
net-tools: /sbin/slattach
net-tools: /usr/sbin/arp

相关内容