易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 684|回复: 2
收起左侧

ubuntu系统查询apt-get命令由什么安装包提供apt-file search方式

[复制链接]
发表于 2023-5-12 22:57:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
ubuntu 或者debian 系统查询1 H; }# @$ O5 ], l  ~' A! y' D
现在安装:1 K8 @7 H) u6 c
apt-get install -y apt-file
1 h7 g7 b# u3 }6 ?/ r, s# I1 b% C  q+ z  E0 N; W) t
7 m2 H0 o- t& q& R
Reading package lists... Done
* q* B7 L! Q% U  d! M9 K) e$ OBuilding dependency tree... Done& p3 C9 O. l( Y6 ]1 T, K6 o
Reading state information... Done9 r5 k! I, P* c- s' u
The following additional packages will be installed:# b; t0 O3 v: J' r. q+ a" X
  libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl
/ ~" A% c" O  K- B' _0 y$ [The following NEW packages will be installed:0 [1 `  _$ w1 a! D, y  \% V
  apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl
. f4 x: \8 ]5 H: e' S+ r1 i0 upgraded, 6 newly installed, 0 to remove and 34 not upgraded.- S2 d1 h3 f0 ~0 ~/ w
Need to get 293 kB of archives.( G  z* H0 ?# ?
After this operation, 887 kB of additional disk space will be used.7 f6 a0 ^5 r3 t9 ]2 o

; R2 R5 |" G' k; w8 G5 d% X" s+ H0 d( g% s: b
5 }* s9 O- _8 R) |
) j% k4 t# o4 v5 [+ q: E8 m4 u  l& Y
root@ubuntu:/home/ubuntu# apt-file search vim
0 E, `& N0 s) g9 H1 E+ W$ d, L4 C6 F, K; ^" F- N
Finding relevant cache files to search ...E: The cache is empty. You need to run "apt-file update" first.
& M2 z1 S  b& C! `4 h( a
' w* M1 p7 s% b  v0 g7 Y/ Q' j. @2 q执行更新:
2 T% ^# _- l& j+ \% _/ V' w" j( }# apt-file update
. K( w1 L# D+ l1 c* n8 E) q: \9 `9 M* ^8 O  U: a+ B9 \% c
root@ubuntu:/home/ubuntu# apt-file update
, Z1 H8 F' k5 iHit:1 http://cn.archive.ubuntu.com/ubuntu jammy InRelease
% t: v7 P  }  l1 S7 A, NHit:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates InRelease9 }, ]! l* Y% O3 J1 m
Hit:3 http://cn.archive.ubuntu.com/ubuntu jammy-backports InRelease; \+ q) m, Z# B/ [
Hit:4 http://cn.archive.ubuntu.com/ubuntu jammy-security InRelease
6 F& w+ B% l7 _9 Q4 J" R7 I" dGet:5 http://cn.archive.ubuntu.com/ubuntu jammy amd64 Contents (deb) [46.9 MB], c1 v+ J5 A  Q

" _4 P8 d$ v  B, Aroot@ubuntu:/home/ubuntu# ifconfig
( B3 `% ^1 r( G$ H9 ~bash: ifconfig: command not found  z$ A' [  n# C+ Q
root@ubuntu:/home/ubuntu# apt-file search ifconfig 0 T8 K; f" N8 r* }7 {
cloud-init: /usr/lib/python3/dist-packages/cloudinit/distros/parsers/ifconfig.py
. H9 p3 T' Q+ }9 d% e9 u. {% xfish-common: /usr/share/fish/completions/ifconfig.fish* E/ ^0 Y4 c5 k/ h/ I6 c
fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/bsd/ifconfig_interface  X! ^; \. x! p
fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/ifconfig_interface- [' E! j' f  @3 W! Q/ Y$ Y* Z5 T, d
fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/rc_conf_ifconfig_interface
. G+ V4 h8 u% E# ~6 f$ igrc: /usr/share/doc/grc/contrib/mrsmith/conf.ifconfig
3 i7 H$ P; q( r' l8 i9 dgrc: /usr/share/grc/conf.ifconfig
; d+ N+ c1 z9 d8 tgrok: /usr/share/doc/grok/examples/ifconfig.grok
/ O: E0 |) S+ w1 Q5 {* jinetutils-tools: /usr/bin/inetutils-ifconfig
, ~4 H' A3 ~0 @! f$ I5 ^, Y2 O. Ginetutils-tools: /usr/share/man/man1/inetutils-ifconfig.1.gz
" M5 ^/ v; j5 J% I. k' G5 a; |jc: /usr/lib/python3/dist-packages/jc/parsers/ifconfig.py
; R. D) p  L* Ejc: /usr/share/doc/jc/parsers/ifconfig.md.gz
5 q) ?0 `0 Y0 @4 r3 M; klibluv-ocaml-dev: /usr/share/doc/libluv-ocaml-dev/examples/ifconfig.ml4 b# m9 N/ E* ]6 z5 [2 J" H8 t$ O& Z
libnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/changelog.Debian.gz
' N  n' G$ S+ @' Vlibnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/copyright0 g& h, V$ |9 b: J, K! ]  @
linux-allwinner-5.17-headers-5.17.0-1010: /usr/src/linux-allwinner-5.17-headers-5.17.0-1010/tools/hv/hv_set_ifconfig.sh2 k0 M( Y, ^& _; y3 e; C4 U) ?. f
linux-allwinner-5.19-headers-5.19.0-1011: /usr/src/linux-allwinner-5.19-headers-5.19.0-1011/tools/hv/hv_set_ifconfig.sh4 s. L: ^. F2 L! n7 v
linux-aws-5.19-headers-5.19.0-1024: /usr/src/linux-aws-5.19-headers-5.19.0-1024/tools/hv/hv_set_ifconfig.sh
4 K6 f; F+ V$ |linux-aws-headers-5.15.0-1004: /usr/src/linux-aws-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
& L$ H9 f& C# X( r  ]" e9 t2 I4 Olinux-aws-headers-5.15.0-1035: /usr/src/linux-aws-headers-5.15.0-1035/tools/hv/hv_set_ifconfig.sh$ ^; U& f; q7 B, H4 n% O& x
linux-azure-5.19-headers-5.19.0-1025: /usr/src/linux-azure-5.19-headers-5.19.0-1025/tools/hv/hv_set_ifconfig.sh' }# R0 I" t0 K, W' i" ^4 P
linux-azure-headers-5.15.0-1003: /usr/src/linux-azure-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh
+ H4 w" Q: E6 k+ a: e& {. r( ilinux-azure-headers-5.15.0-1037: /usr/src/linux-azure-headers-5.15.0-1037/tools/hv/hv_set_ifconfig.sh
. O. R. g9 H& t: y( Q; P' M$ ilinux-cloud-tools-common: /usr/sbin/hv_set_ifconfig  ~0 M; Q8 w$ [2 D; Q
linux-gcp-5.19-headers-5.19.0-1022: /usr/src/linux-gcp-5.19-headers-5.19.0-1022/tools/hv/hv_set_ifconfig.sh1 X5 _9 R5 S" R' L8 N- c- g2 S% @7 Y
linux-gcp-headers-5.15.0-1003: /usr/src/linux-gcp-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh& o, ~! q* U, B% \0 x* U
linux-gcp-headers-5.15.0-1032: /usr/src/linux-gcp-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh5 w' t$ m3 J* N" ]% h3 K; Y+ t
linux-gke-headers-5.15.0-1002: /usr/src/linux-gke-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
4 w4 n7 v3 a2 Dlinux-gke-headers-5.15.0-1032: /usr/src/linux-gke-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
+ x; ?; }1 J$ n* Slinux-gkeop-headers-5.15.0-1019: /usr/src/linux-gkeop-headers-5.15.0-1019/tools/hv/hv_set_ifconfig.sh
( O6 D8 b! \. F7 flinux-headers-5.15.0-25: /usr/src/linux-headers-5.15.0-25/tools/hv/hv_set_ifconfig.sh$ ~# e+ D, \( J& q
linux-headers-5.15.0-71: /usr/src/linux-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh
# n" ^5 ~$ u/ V6 ]0 ?linux-hwe-5.19-headers-5.19.0-41: /usr/src/linux-hwe-5.19-headers-5.19.0-41/tools/hv/hv_set_ifconfig.sh
1 O5 P& v1 B6 {$ m7 V/ E6 Y; `linux-ibm-headers-5.15.0-1002: /usr/src/linux-ibm-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh* G  S6 g& J- ~# Y; Q7 e# E4 i2 c
linux-ibm-headers-5.15.0-1029: /usr/src/linux-ibm-headers-5.15.0-1029/tools/hv/hv_set_ifconfig.sh
$ O5 W( T5 C- I8 D& wlinux-intel-iotg-cloud-tools-common: /usr/sbin/hv_set_ifconfig
" I) I" a: }7 Y: j7 y  ]8 @linux-intel-iotg-headers-5.15.0-1004: /usr/src/linux-intel-iotg-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
; b2 i) [8 u4 J$ B7 l: plinux-intel-iotg-headers-5.15.0-1028: /usr/src/linux-intel-iotg-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh
* v' G/ ~% S# E4 Vlinux-kvm-headers-5.15.0-1004: /usr/src/linux-kvm-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh! J3 r9 f7 j* x6 H! s
linux-kvm-headers-5.15.0-1032: /usr/src/linux-kvm-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
' I5 h7 H; G1 B# t3 ^' hlinux-lowlatency-headers-5.15.0-24: /usr/src/linux-lowlatency-headers-5.15.0-24/tools/hv/hv_set_ifconfig.sh
" A: `1 o+ g9 T  Dlinux-lowlatency-headers-5.15.0-71: /usr/src/linux-lowlatency-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh  }. ?+ x+ s( S- A/ W
linux-lowlatency-hwe-5.19-headers-5.19.0-1023: /usr/src/linux-lowlatency-hwe-5.19-headers-5.19.0-1023/tools/hv/hv_set_ifconfig.sh6 t2 O0 \9 S  Q9 A. ~  M9 T
linux-nvidia-5.19-cloud-tools-common: /usr/sbin/hv_set_ifconfig
  i- y& w0 \4 T8 o0 m# Qlinux-nvidia-5.19-headers-5.19.0-1010: /usr/src/linux-nvidia-5.19-headers-5.19.0-1010/tools/hv/hv_set_ifconfig.sh, p  N, o) S  j. f5 w" i
linux-nvidia-cloud-tools-common: /usr/sbin/hv_set_ifconfig
" K( _, T. `/ P  M- y, nlinux-nvidia-headers-5.15.0-1023: /usr/src/linux-nvidia-headers-5.15.0-1023/tools/hv/hv_set_ifconfig.sh: S# H; W/ O2 r! l# i3 `; M4 S
linux-nvidia-tegra-headers-5.15.0-1012: /usr/src/linux-nvidia-tegra-headers-5.15.0-1012/tools/hv/hv_set_ifconfig.sh+ ?: z: t1 d1 @* O0 I. B1 k. Y
linux-oem-5.17-headers-5.17.0-1003: /usr/src/linux-oem-5.17-headers-5.17.0-1003/tools/hv/hv_set_ifconfig.sh
+ d6 G% m9 |2 x% S* ?. G* hlinux-oem-5.17-headers-5.17.0-1031: /usr/src/linux-oem-5.17-headers-5.17.0-1031/tools/hv/hv_set_ifconfig.sh
, O$ T, P- O% L8 l' ]1 s2 z4 Vlinux-oem-6.0-headers-6.0.0-1015: /usr/src/linux-oem-6.0-headers-6.0.0-1015/tools/hv/hv_set_ifconfig.sh
4 h7 Z, k5 y# _1 mlinux-oem-6.1-headers-6.1.0-1010: /usr/src/linux-oem-6.1-headers-6.1.0-1010/tools/hv/hv_set_ifconfig.sh" b7 m' k! F6 A5 x+ o
linux-oracle-headers-5.15.0-1002: /usr/src/linux-oracle-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh# x& \/ U; x$ _$ L1 b% S+ n3 y
linux-oracle-headers-5.15.0-1034: /usr/src/linux-oracle-headers-5.15.0-1034/tools/hv/hv_set_ifconfig.sh
: o$ H- ]/ u, W% w( {1 U  V- o2 Qlinux-realtime-headers-5.15.0-1032: /usr/src/linux-realtime-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh9 E* R" L4 {2 m2 m2 {3 C7 _! H
linux-riscv-5.19-headers-5.19.0-1017: /usr/src/linux-riscv-5.19-headers-5.19.0-1017/tools/hv/hv_set_ifconfig.sh
" ]( ~& |5 V- x; @" X$ C5 Llinux-riscv-headers-5.15.0-1007: /usr/src/linux-riscv-headers-5.15.0-1007/tools/hv/hv_set_ifconfig.sh% T4 Y' y$ M& I4 x$ I9 O
linux-riscv-headers-5.15.0-1028: /usr/src/linux-riscv-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh" k1 L& q. Z' I' }5 P
linux-source-5.15.0: /usr/src/linux-source-5.15.0/debian/cloud-tools/hv_set_ifconfig
7 {4 z5 }+ o' e+ ?linux-source-5.19.0: /usr/src/linux-source-5.19.0/debian/cloud-tools/hv_set_ifconfig- e" V/ S/ k. p; }; b9 i
linux-starfive-5.17-headers-5.17.0-1012: /usr/src/linux-starfive-5.17-headers-5.17.0-1012/tools/hv/hv_set_ifconfig.sh7 s# t! L; C. O- O* z. n7 D
linux-starfive-5.19-headers-5.19.0-1016: /usr/src/linux-starfive-5.19-headers-5.19.0-1016/tools/hv/hv_set_ifconfig.sh
% G. }3 m: w8 |( X+ w( l& Xmanpages-es: /usr/share/man/es/man8/ifconfig.8.gz. X5 J( x  a/ F1 \! T1 o2 O# V# L
manpages-ja: /usr/share/man/ja/man8/ifconfig.8.gz( I5 y6 h0 y0 d/ J+ L, ~" Y9 k
manpages-pl: /usr/share/man/pl/man8/ifconfig.8.gz- \4 I5 M$ j8 u5 Q8 }' L
manpages-tr: /usr/share/man/tr/man8/ifconfig.8.gz* F8 m: O% \& l' m0 v0 p3 w1 l  l$ D
manpages-zh: /usr/share/man/zh_CN/man8/ifconfig.8.gz( H* B. [4 f4 T$ ]; s$ s( m4 r" ]
manpages-zh: /usr/share/man/zh_TW/man8/ifconfig.8.gz
0 x5 H4 Q8 J6 j5 Unet-tools: /sbin/ifconfig: H4 D% \" m6 a" f/ c+ E5 m
net-tools: /usr/share/man/de/man8/ifconfig.8.gz
+ ?, w. x  ?0 ?2 ^/ b& K: k/ q) u$ Lnet-tools: /usr/share/man/fr/man8/ifconfig.8.gz/ }9 n0 v) ^; d& X0 p& V
net-tools: /usr/share/man/man8/ifconfig.8.gz) m" [! X% g4 D
net-tools: /usr/share/man/pt_BR/man8/ifconfig.8.gz, D: D3 p( T) h+ d) ~- \  B$ T
python-psutil-doc: /usr/share/doc/python-psutil-doc/examples/ifconfig.py( B& K7 |% i8 g# o
python3-ethtool: /usr/sbin/pifconfig3
" L0 {3 I* e9 U/ o7 rpython3-ethtool: /usr/share/man/man8/pifconfig3.8.gz
( w/ ]: U) r: W* }# D6 ppython3-sphinx: /usr/lib/python3/dist-packages/sphinx/ext/ifconfig.py
8 u0 F# h6 M, y4 I' t& x+ Pruby-packetfu: /usr/share/doc/ruby-packetfu/examples/ifconfig.rb) M) M6 r0 R5 n  l' q
sphinx-doc: /usr/share/doc/sphinx-doc/html/_sources/usage/extensions/ifconfig.rst.txt2 i! f; y" T, w7 m& ~7 w0 f7 h
sphinx-doc: /usr/share/doc/sphinx-doc/html/usage/extensions/ifconfig.html5 v' ~! r/ F2 Y$ `4 m
thefuck: /usr/share/thefuck/thefuck/rules/ifconfig_device_not_found.py9 V- r. y% @5 c
weevely: /usr/share/weevely/modules/net/ifconfig.py
7 \5 u& I! a5 ?8 H6 {) E& a1 V; l: Vzsh-common: /usr/share/zsh/functions/Completion/Unix/_ifconfig
% ^/ g; c6 P  e2 c6 o
8 Y! M" s9 y9 [8 E; A7 o! R5 t" U7 T- Z" c
# y& p: Q$ d% P* f
8 Q# O: ?4 p; Y
, `$ C4 e, i9 g( p, h
+ K8 A5 N# }. ]4 A+ O7 S
) H2 _0 j9 k2 X  U7 Z8 `" ]
 楼主| 发表于 2023-5-12 22:58:30 | 显示全部楼层
apt install -y apt-file && apt-file update && apt-file search netstat |grep bin
8 q0 W7 [. \2 {3 p0 K8 }2 {$ `8 P
; i. B" J; H( K  \8 q然后你会看到那么几行。从列出来的包名和后面的绝对路径可以判断出应该安装的是net-tools包,所以执行apt install -y net-tools
 楼主| 发表于 2023-5-12 23:26:32 | 显示全部楼层
root@localhost:~# apt-file search -x 'bin/ifconfig$'
& v9 {9 H& G4 Ynet-tools: /sbin/ifconfig                 6 d" g' X- Q! V+ i, F8 c
root@localhost:~# apt-file search -x 'bin/rz$'
/ Y) e, A8 C( A6 U+ ^8 Ilrzsz: /usr/bin/rz        
               
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 23:48 , Processed in 0.057256 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表