找回密码
 注册
查看: 715|回复: 2

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-5-12 22:57:43 | 显示全部楼层 |阅读模式
ubuntu 或者debian 系统查询
+ z( ]0 r0 ~: r, U现在安装:
2 D# h1 \+ b3 F, M& j: j apt-get install -y apt-file
4 o! R( p+ y' \; P5 {& F' k0 f) x+ z: e' @. P+ S
6 i3 i) s. T* h. Y; J
Reading package lists... Done
- D# P8 r" k6 z* _Building dependency tree... Done+ ~6 C% E- w7 K7 ?- h+ {
Reading state information... Done
% D. \- O7 Q  x4 `8 P7 {# H. n* nThe following additional packages will be installed:, \/ y, |4 z# K
  libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl4 L; H5 T0 w0 d2 R
The following NEW packages will be installed:1 d% o' U! W% c" y' u  ?* o3 o
  apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl) o/ p+ p0 w( P, o9 [: v- t: p. c
0 upgraded, 6 newly installed, 0 to remove and 34 not upgraded.  v" @9 |" D1 t9 ^5 B
Need to get 293 kB of archives.1 h9 y/ N- j  r$ J) R0 i, ^, b) `
After this operation, 887 kB of additional disk space will be used.$ ]/ Y( ?, x% M, O0 \
% r0 @& A* G: Y# [1 C0 O5 X

* F* m* R, t9 G( S" M5 E1 e$ o7 q! E$ m

' V' }2 ]) Z3 a! wroot@ubuntu:/home/ubuntu# apt-file search vim
3 h1 \. j! ^$ c6 h8 v0 L1 \, o+ w( d$ `' U5 o& N7 B5 n
Finding relevant cache files to search ...E: The cache is empty. You need to run "apt-file update" first.
) z( J7 ^7 Y& J" h/ @7 W
& ?# s1 i: z2 x+ R6 l6 G( F# \执行更新:
" E9 w! f9 o- g/ `# apt-file update
* V8 H& {& p# @% F" K: q
  n. K, x5 q4 y; j8 @: [2 e" f( kroot@ubuntu:/home/ubuntu# apt-file update
; ^) O, |9 s# ?( e6 HHit:1 http://cn.archive.ubuntu.com/ubuntu jammy InRelease! e' _( N+ _" X% K6 H+ o* E( {
Hit:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates InRelease
3 ~/ j3 q" R7 ]1 c8 D7 s# l& DHit:3 http://cn.archive.ubuntu.com/ubuntu jammy-backports InRelease2 ?+ g9 L* X! `! ~
Hit:4 http://cn.archive.ubuntu.com/ubuntu jammy-security InRelease( k$ p, I4 l8 S) B; v" ^3 e, x! p
Get:5 http://cn.archive.ubuntu.com/ubuntu jammy amd64 Contents (deb) [46.9 MB]% C  L; W+ J7 \/ L

9 J; n; J) I. f  h/ h9 H) L( Kroot@ubuntu:/home/ubuntu# ifconfig
4 x" |' Q$ T7 ~4 V: h3 j. ybash: ifconfig: command not found
0 m$ O6 A5 o0 @3 u. s/ proot@ubuntu:/home/ubuntu# apt-file search ifconfig ) [! J. X% B. }
cloud-init: /usr/lib/python3/dist-packages/cloudinit/distros/parsers/ifconfig.py! Z/ o" B- w* k2 i: R
fish-common: /usr/share/fish/completions/ifconfig.fish
# m0 A% {+ ]( Q4 T% {& |fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/bsd/ifconfig_interface
& x# q1 D- b3 Gfwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/ifconfig_interface
% ^0 C% r2 R+ c7 b2 ]6 cfwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/rc_conf_ifconfig_interface2 H6 T$ r- f. L4 a1 M
grc: /usr/share/doc/grc/contrib/mrsmith/conf.ifconfig
- G' x; K" `; }grc: /usr/share/grc/conf.ifconfig
+ |' H4 z, ~8 i% ^" O: H$ Qgrok: /usr/share/doc/grok/examples/ifconfig.grok
* r$ e2 g8 H) U" minetutils-tools: /usr/bin/inetutils-ifconfig
; @) a) ^- V# y  ]# }. z1 U: h9 Ainetutils-tools: /usr/share/man/man1/inetutils-ifconfig.1.gz: D! @/ t3 Z. W- f! d
jc: /usr/lib/python3/dist-packages/jc/parsers/ifconfig.py
; t3 C- X4 b2 K+ R. ~jc: /usr/share/doc/jc/parsers/ifconfig.md.gz
$ T! Y! m( N4 W: o4 }' F4 slibluv-ocaml-dev: /usr/share/doc/libluv-ocaml-dev/examples/ifconfig.ml
! F! V8 J. ~! Glibnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/changelog.Debian.gz
. X7 U# A. z, [6 alibnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/copyright, Q5 E0 z8 v2 r7 k, n! E
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.sh
! L( [" i6 P2 Llinux-allwinner-5.19-headers-5.19.0-1011: /usr/src/linux-allwinner-5.19-headers-5.19.0-1011/tools/hv/hv_set_ifconfig.sh  W" o4 V7 g( S6 u" h
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
; Y4 K2 [5 T' Y" ]0 z: _linux-aws-headers-5.15.0-1004: /usr/src/linux-aws-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
) q4 _9 X- C6 T* t/ Wlinux-aws-headers-5.15.0-1035: /usr/src/linux-aws-headers-5.15.0-1035/tools/hv/hv_set_ifconfig.sh4 s2 B. ~$ I/ C7 N
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
  T3 @8 v  l: T; [& Llinux-azure-headers-5.15.0-1003: /usr/src/linux-azure-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh
2 C( Q: T" o3 y3 ~linux-azure-headers-5.15.0-1037: /usr/src/linux-azure-headers-5.15.0-1037/tools/hv/hv_set_ifconfig.sh: A+ R% }- i* b. H. t2 N
linux-cloud-tools-common: /usr/sbin/hv_set_ifconfig+ K5 Y/ r5 P3 _% o1 I3 j
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.sh$ y' f$ B# P6 e3 A& [
linux-gcp-headers-5.15.0-1003: /usr/src/linux-gcp-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh! f  d) ~8 F( u0 [+ V2 F
linux-gcp-headers-5.15.0-1032: /usr/src/linux-gcp-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
8 q& H. k2 n% q7 {- Q$ S( clinux-gke-headers-5.15.0-1002: /usr/src/linux-gke-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
  N- i# t+ h; f( k. A5 zlinux-gke-headers-5.15.0-1032: /usr/src/linux-gke-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
" \* j+ s$ i  a1 m0 Alinux-gkeop-headers-5.15.0-1019: /usr/src/linux-gkeop-headers-5.15.0-1019/tools/hv/hv_set_ifconfig.sh, F0 _2 R8 ^$ K* |% H  h
linux-headers-5.15.0-25: /usr/src/linux-headers-5.15.0-25/tools/hv/hv_set_ifconfig.sh4 Y# R) H8 g2 y1 o- c  S: T" i
linux-headers-5.15.0-71: /usr/src/linux-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh6 G1 }. X/ w; T# W; _3 ?
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.sh2 p9 B1 ?# r* n
linux-ibm-headers-5.15.0-1002: /usr/src/linux-ibm-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
$ f* O" s, m+ A3 I' \) l3 H0 ^% clinux-ibm-headers-5.15.0-1029: /usr/src/linux-ibm-headers-5.15.0-1029/tools/hv/hv_set_ifconfig.sh5 C2 z% h1 e# y' v8 ~
linux-intel-iotg-cloud-tools-common: /usr/sbin/hv_set_ifconfig3 i' Q: C2 L. m: y
linux-intel-iotg-headers-5.15.0-1004: /usr/src/linux-intel-iotg-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh% F3 U( r$ c! t: ^& f, ]' j
linux-intel-iotg-headers-5.15.0-1028: /usr/src/linux-intel-iotg-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh  m9 p+ |  Q! q3 s. |* l
linux-kvm-headers-5.15.0-1004: /usr/src/linux-kvm-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
, Q% V$ u0 X7 O0 `5 M& I/ s9 ~linux-kvm-headers-5.15.0-1032: /usr/src/linux-kvm-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
- f) j0 V4 v3 j5 j4 W4 T- Flinux-lowlatency-headers-5.15.0-24: /usr/src/linux-lowlatency-headers-5.15.0-24/tools/hv/hv_set_ifconfig.sh
+ L# E' C" S8 B) d0 Wlinux-lowlatency-headers-5.15.0-71: /usr/src/linux-lowlatency-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh
+ h( ^6 {+ V( ?; j- o9 M" Glinux-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.sh
) z7 c1 g: Z) F% ~0 hlinux-nvidia-5.19-cloud-tools-common: /usr/sbin/hv_set_ifconfig
9 Y7 {) ]1 V) X! Mlinux-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
. x/ K. B+ h1 X: u1 m% vlinux-nvidia-cloud-tools-common: /usr/sbin/hv_set_ifconfig
2 p' K, i7 L5 ]* S$ B- F* b: K% Alinux-nvidia-headers-5.15.0-1023: /usr/src/linux-nvidia-headers-5.15.0-1023/tools/hv/hv_set_ifconfig.sh7 f! Z/ G  L& ^7 i
linux-nvidia-tegra-headers-5.15.0-1012: /usr/src/linux-nvidia-tegra-headers-5.15.0-1012/tools/hv/hv_set_ifconfig.sh
: j9 y4 q* @2 L: n- ^9 G% flinux-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: n' V. t; i7 d: Z
linux-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% f5 n1 C: \4 o! E" ]
linux-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
8 B4 |/ M) Z3 ilinux-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( X7 y- r/ @) V! c
linux-oracle-headers-5.15.0-1002: /usr/src/linux-oracle-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
: J9 S: D0 f# z4 Blinux-oracle-headers-5.15.0-1034: /usr/src/linux-oracle-headers-5.15.0-1034/tools/hv/hv_set_ifconfig.sh9 C. `; n/ {8 p0 Y1 V
linux-realtime-headers-5.15.0-1032: /usr/src/linux-realtime-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh& m4 q5 |6 k0 F: q/ i5 F, b3 k3 r1 h; a
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.sh4 ]4 |) g1 r3 y! X, M
linux-riscv-headers-5.15.0-1007: /usr/src/linux-riscv-headers-5.15.0-1007/tools/hv/hv_set_ifconfig.sh
$ d; ]  d7 U5 {8 {9 }3 Blinux-riscv-headers-5.15.0-1028: /usr/src/linux-riscv-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh0 j9 T* C/ }: e$ d, ~! M$ J8 h+ f3 N% t
linux-source-5.15.0: /usr/src/linux-source-5.15.0/debian/cloud-tools/hv_set_ifconfig
" c% x! O7 z1 \6 n& z  T  r- ^2 S1 Klinux-source-5.19.0: /usr/src/linux-source-5.19.0/debian/cloud-tools/hv_set_ifconfig
  W( ^$ e5 x6 Z# \' Ylinux-starfive-5.17-headers-5.17.0-1012: /usr/src/linux-starfive-5.17-headers-5.17.0-1012/tools/hv/hv_set_ifconfig.sh5 z: @. t3 m$ u- ?; R$ Q
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
. r4 V1 {* ~. P* O+ T$ s4 u( tmanpages-es: /usr/share/man/es/man8/ifconfig.8.gz5 U. z3 O) ~% n0 C: @5 |7 @" w
manpages-ja: /usr/share/man/ja/man8/ifconfig.8.gz. C# H! F$ ?9 P. ]. v
manpages-pl: /usr/share/man/pl/man8/ifconfig.8.gz
1 b7 v& R; Z& Z' }/ Qmanpages-tr: /usr/share/man/tr/man8/ifconfig.8.gz
$ f7 c* ?& z4 ]- W2 N6 D7 Smanpages-zh: /usr/share/man/zh_CN/man8/ifconfig.8.gz
# D. a, o. G' ymanpages-zh: /usr/share/man/zh_TW/man8/ifconfig.8.gz: u. a4 d! ~  T& ^! J/ |- p. p
net-tools: /sbin/ifconfig
7 J( |+ d4 p/ ~; r9 \2 {net-tools: /usr/share/man/de/man8/ifconfig.8.gz. ?$ @0 t! ]" T* {' s& b  _, X$ S
net-tools: /usr/share/man/fr/man8/ifconfig.8.gz
3 G0 q# ~* k, S  N' ^; i; lnet-tools: /usr/share/man/man8/ifconfig.8.gz+ i; F8 y: U7 j* O: Y8 x0 [
net-tools: /usr/share/man/pt_BR/man8/ifconfig.8.gz& P3 f! W9 Y5 A# L
python-psutil-doc: /usr/share/doc/python-psutil-doc/examples/ifconfig.py- h1 K2 J) b0 Y3 M# A2 u0 N
python3-ethtool: /usr/sbin/pifconfig35 |" V+ f2 z$ [! o5 {2 n- _
python3-ethtool: /usr/share/man/man8/pifconfig3.8.gz
  ?9 ~: }+ P. ?8 j% Hpython3-sphinx: /usr/lib/python3/dist-packages/sphinx/ext/ifconfig.py
; O+ m& r: a* iruby-packetfu: /usr/share/doc/ruby-packetfu/examples/ifconfig.rb, I6 v, j! S! w7 F$ V, c# W1 J
sphinx-doc: /usr/share/doc/sphinx-doc/html/_sources/usage/extensions/ifconfig.rst.txt
$ N4 V$ y  }! ?. n% ~3 Ksphinx-doc: /usr/share/doc/sphinx-doc/html/usage/extensions/ifconfig.html
8 u9 x7 a( c1 z! Dthefuck: /usr/share/thefuck/thefuck/rules/ifconfig_device_not_found.py3 Z0 `% q' o6 D" \0 ^
weevely: /usr/share/weevely/modules/net/ifconfig.py
) W/ B7 `! e( Z6 x- l4 K) b2 qzsh-common: /usr/share/zsh/functions/Completion/Unix/_ifconfig1 W' g' ]1 |9 M+ h; c

6 C( O9 V) e# b
4 v2 [! B( b* C' m7 d+ s3 a
: Y0 C8 y* N; s
( J4 C) }  I9 C- F, Z  m& Z( t
) ~$ O8 l- ?  I5 C( G, r9 T) `& _+ G. p( L0 @

; n$ r0 d; D* V! U3 S

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-5-12 22:58:30 | 显示全部楼层
apt install -y apt-file && apt-file update && apt-file search netstat |grep bin+ I* D- Y. ^* f
# d) \- _7 F) Y: |  k/ s
然后你会看到那么几行。从列出来的包名和后面的绝对路径可以判断出应该安装的是net-tools包,所以执行apt install -y net-tools

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-5-12 23:26:32 | 显示全部楼层
root@localhost:~# apt-file search -x 'bin/ifconfig$'& b* |2 Q- t" s8 x! g1 X. K# Q
net-tools: /sbin/ifconfig                 
2 C$ A/ t' y* ^& R6 a6 n$ kroot@localhost:~# apt-file search -x 'bin/rz$'
7 h* ^* i' F8 E" K* elrzsz: /usr/bin/rz        
               
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 03:06 , Processed in 0.025326 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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