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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-5-12 22:57:43 | 显示全部楼层 |阅读模式
ubuntu 或者debian 系统查询
, [' ]- H8 |4 W$ g3 U: z现在安装:% ]: S. r- d  I$ E2 K+ e
apt-get install -y apt-file; M! @% C. ]0 H# r8 e) ]
, B& @+ p$ p+ V9 G! |! l5 E" H( C
$ o% k6 \5 y  S( |- J$ a
Reading package lists... Done
- ~5 N% s) k4 D" K1 ?Building dependency tree... Done6 y2 _6 b6 R5 `* \! ^  i) d
Reading state information... Done
7 t# g( |- C& I7 C  z" f9 u; SThe following additional packages will be installed:
* O3 C) D' I( G' X' l  libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl. g, z) R) P6 N) L2 h4 {' i* W* p
The following NEW packages will be installed:
/ P% O0 ~3 v7 {! z  d  apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl9 y5 K. p  K/ [
0 upgraded, 6 newly installed, 0 to remove and 34 not upgraded.5 g3 n& H% G. q) O0 }- U8 O* t
Need to get 293 kB of archives.
" `- L. Y4 R1 a/ N2 JAfter this operation, 887 kB of additional disk space will be used.- T- }' S* _0 u& N( K5 @

+ ^- i* n4 n/ A3 l/ K' M+ Z$ G& ]) i" a4 Q7 h5 G

% m) @! Z( @# C; l
4 H: ~+ L% e& M: Broot@ubuntu:/home/ubuntu# apt-file search vim . Q/ B; _; Y9 \

5 k4 A6 A4 ?3 _; u  U7 r1 w7 {Finding relevant cache files to search ...E: The cache is empty. You need to run "apt-file update" first.7 i8 F, K! b+ Y& B
+ |2 [1 N, l( D
执行更新:  {3 h7 c( O& y6 @2 p. `# d
# apt-file update
5 ^6 A1 M( Y/ N) C
+ K, r( U1 {, \2 ~& [0 M7 groot@ubuntu:/home/ubuntu# apt-file update0 ^; t- I! g+ q; K
Hit:1 http://cn.archive.ubuntu.com/ubuntu jammy InRelease! g: a4 Y% ~) I  ^. N) F! B
Hit:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates InRelease
0 p$ L; ^0 _3 v1 FHit:3 http://cn.archive.ubuntu.com/ubuntu jammy-backports InRelease1 G  Q/ |/ U7 l' m
Hit:4 http://cn.archive.ubuntu.com/ubuntu jammy-security InRelease
6 `% Y$ t9 J4 B' ^4 xGet:5 http://cn.archive.ubuntu.com/ubuntu jammy amd64 Contents (deb) [46.9 MB]
) O# i+ s" d4 s- O) O8 i) W2 N. D: I2 E& p) Y" H
root@ubuntu:/home/ubuntu# ifconfig
5 ], [" E8 N  Z4 b1 I" Ubash: ifconfig: command not found3 ]% U& o( ~2 Q8 C1 l- q  u
root@ubuntu:/home/ubuntu# apt-file search ifconfig . M" D: c: r0 I
cloud-init: /usr/lib/python3/dist-packages/cloudinit/distros/parsers/ifconfig.py
; k" ~3 ?4 _  Sfish-common: /usr/share/fish/completions/ifconfig.fish
8 o+ f( I; E* g& E+ \. pfwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/bsd/ifconfig_interface( w6 S( C: m0 I: S5 t4 w9 L
fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/ifconfig_interface
' V9 I* y: ^0 y) m: n) ffwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/rc_conf_ifconfig_interface
( h6 c, n1 @6 b- ~  O- Qgrc: /usr/share/doc/grc/contrib/mrsmith/conf.ifconfig
. C- p- D7 o7 |  i' q; pgrc: /usr/share/grc/conf.ifconfig
7 I0 C7 o2 x; p& ]4 egrok: /usr/share/doc/grok/examples/ifconfig.grok
  y3 X0 A9 ^' C1 C5 a+ ninetutils-tools: /usr/bin/inetutils-ifconfig, D0 Q( V3 p  S5 w
inetutils-tools: /usr/share/man/man1/inetutils-ifconfig.1.gz  Y! g6 m3 z# N+ K5 [
jc: /usr/lib/python3/dist-packages/jc/parsers/ifconfig.py
4 ^: {" m0 N* r% |4 ~0 P$ R7 ljc: /usr/share/doc/jc/parsers/ifconfig.md.gz1 z2 r7 s0 I3 {  Z+ p
libluv-ocaml-dev: /usr/share/doc/libluv-ocaml-dev/examples/ifconfig.ml4 w2 u$ R$ `- m
libnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/changelog.Debian.gz
# E3 V! Q0 T: z  ~+ ?libnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/copyright
0 x! ~+ w" `, J$ `4 t' [- Ulinux-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' y) |  P$ S2 _9 \
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.sh1 F8 F+ ?9 `* r/ a2 M! q/ A
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% Z; K" K1 v- S3 i, @: t0 ~/ n7 @
linux-aws-headers-5.15.0-1004: /usr/src/linux-aws-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh' Y2 n  b( u5 p) K" V* O4 _# r  r) k' s
linux-aws-headers-5.15.0-1035: /usr/src/linux-aws-headers-5.15.0-1035/tools/hv/hv_set_ifconfig.sh! N) X. @. {. H: ^8 V0 k' k+ Y; M' u
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
1 j4 ?0 Z' n' n0 J) r( ]: {linux-azure-headers-5.15.0-1003: /usr/src/linux-azure-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh  e0 S$ ^4 b& |% }- v
linux-azure-headers-5.15.0-1037: /usr/src/linux-azure-headers-5.15.0-1037/tools/hv/hv_set_ifconfig.sh4 g9 Q5 n( }0 W, t- w
linux-cloud-tools-common: /usr/sbin/hv_set_ifconfig
- F$ i. N9 x. q# s( qlinux-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
' i$ B& K- v4 N' h: Flinux-gcp-headers-5.15.0-1003: /usr/src/linux-gcp-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh; [* R6 T( J( _# I- a; l: O
linux-gcp-headers-5.15.0-1032: /usr/src/linux-gcp-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh1 V: f  L" W! h/ D
linux-gke-headers-5.15.0-1002: /usr/src/linux-gke-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh2 o$ |( Y' ]! i* S3 D6 K
linux-gke-headers-5.15.0-1032: /usr/src/linux-gke-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh1 S7 N+ y/ @( N
linux-gkeop-headers-5.15.0-1019: /usr/src/linux-gkeop-headers-5.15.0-1019/tools/hv/hv_set_ifconfig.sh3 ?. P( |. C2 y, K
linux-headers-5.15.0-25: /usr/src/linux-headers-5.15.0-25/tools/hv/hv_set_ifconfig.sh
3 h$ h. r! a( {! Z& M( w' Qlinux-headers-5.15.0-71: /usr/src/linux-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh
7 F/ d/ X  v6 k2 m- Zlinux-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 {3 `! d6 S# D+ W
linux-ibm-headers-5.15.0-1002: /usr/src/linux-ibm-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
0 l5 p. x: Q/ n; l& Y. tlinux-ibm-headers-5.15.0-1029: /usr/src/linux-ibm-headers-5.15.0-1029/tools/hv/hv_set_ifconfig.sh
1 }3 k3 `! {2 I& ^: T; N) y7 J' Glinux-intel-iotg-cloud-tools-common: /usr/sbin/hv_set_ifconfig1 b% P0 v* e' [( S# q# u
linux-intel-iotg-headers-5.15.0-1004: /usr/src/linux-intel-iotg-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
+ C$ o+ V; d! Z2 Llinux-intel-iotg-headers-5.15.0-1028: /usr/src/linux-intel-iotg-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh( P( W5 N3 d5 `0 L0 C+ G1 W
linux-kvm-headers-5.15.0-1004: /usr/src/linux-kvm-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh  O3 {0 H" D, \$ Y" `: q
linux-kvm-headers-5.15.0-1032: /usr/src/linux-kvm-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh+ l7 ]: X4 x1 s9 w) k% p
linux-lowlatency-headers-5.15.0-24: /usr/src/linux-lowlatency-headers-5.15.0-24/tools/hv/hv_set_ifconfig.sh
2 U- L( {: O: M& e( N% mlinux-lowlatency-headers-5.15.0-71: /usr/src/linux-lowlatency-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh2 I: v" o  `: D3 g
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.sh& b9 P+ H: T. a' r+ j
linux-nvidia-5.19-cloud-tools-common: /usr/sbin/hv_set_ifconfig) I. J% B6 U. w" t, D
linux-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
/ Q5 T& v) ^: |6 n: A4 J0 f# M9 Zlinux-nvidia-cloud-tools-common: /usr/sbin/hv_set_ifconfig7 n: k. x2 m, C* |0 T+ y
linux-nvidia-headers-5.15.0-1023: /usr/src/linux-nvidia-headers-5.15.0-1023/tools/hv/hv_set_ifconfig.sh) F8 z1 K  }1 R
linux-nvidia-tegra-headers-5.15.0-1012: /usr/src/linux-nvidia-tegra-headers-5.15.0-1012/tools/hv/hv_set_ifconfig.sh  V3 t3 f( K3 }# S( _$ l- {- 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.sh2 `, C! A; v) B) \+ `' f
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+ s( a* Y& P4 ~. ^1 g! z
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.sh3 Y& ?( \% [- N2 j% d0 C) S* g
linux-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% c: S7 _6 d+ S+ k: D2 U
linux-oracle-headers-5.15.0-1002: /usr/src/linux-oracle-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
& _- s( p7 p0 {3 {& mlinux-oracle-headers-5.15.0-1034: /usr/src/linux-oracle-headers-5.15.0-1034/tools/hv/hv_set_ifconfig.sh
4 a' y! ^' F8 \  }linux-realtime-headers-5.15.0-1032: /usr/src/linux-realtime-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
, H; X) Q7 \0 j- U6 Llinux-riscv-5.19-headers-5.19.0-1017: /usr/src/linux-riscv-5.19-headers-5.19.0-1017/tools/hv/hv_set_ifconfig.sh8 W9 C' T& f3 o+ [3 C
linux-riscv-headers-5.15.0-1007: /usr/src/linux-riscv-headers-5.15.0-1007/tools/hv/hv_set_ifconfig.sh
) T: n( |  M1 z& A$ ?linux-riscv-headers-5.15.0-1028: /usr/src/linux-riscv-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh
! S. p7 @" ?9 }: t3 ylinux-source-5.15.0: /usr/src/linux-source-5.15.0/debian/cloud-tools/hv_set_ifconfig
$ A) z3 M5 H2 l& Q8 ^  Tlinux-source-5.19.0: /usr/src/linux-source-5.19.0/debian/cloud-tools/hv_set_ifconfig* _6 u; Z6 O  q( E. w$ k1 [
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.sh, N% c  U& Q! _  s: \5 ^: `, t
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
4 H4 b% m3 |0 Qmanpages-es: /usr/share/man/es/man8/ifconfig.8.gz
; T. D2 j9 ~! h9 amanpages-ja: /usr/share/man/ja/man8/ifconfig.8.gz1 G* _7 N  }  \1 t0 o
manpages-pl: /usr/share/man/pl/man8/ifconfig.8.gz# Q( [8 `! e% X. w6 k, o( `1 k
manpages-tr: /usr/share/man/tr/man8/ifconfig.8.gz/ f5 U5 J2 `! Q& L3 b
manpages-zh: /usr/share/man/zh_CN/man8/ifconfig.8.gz
* X; p  v  n+ D/ [2 Z1 ]manpages-zh: /usr/share/man/zh_TW/man8/ifconfig.8.gz$ \+ f% @1 y) Q* e1 ?
net-tools: /sbin/ifconfig
% w9 E" Z7 I0 [$ o: P, {7 P+ {net-tools: /usr/share/man/de/man8/ifconfig.8.gz
% l# V% W+ T$ K4 Y9 Cnet-tools: /usr/share/man/fr/man8/ifconfig.8.gz
! X% l6 Y; r2 Anet-tools: /usr/share/man/man8/ifconfig.8.gz, R! K& _, A: ]) Z/ @
net-tools: /usr/share/man/pt_BR/man8/ifconfig.8.gz/ W; c8 v: W) N  K0 N% _
python-psutil-doc: /usr/share/doc/python-psutil-doc/examples/ifconfig.py" f! D! o' Q0 ~' q7 ?; z
python3-ethtool: /usr/sbin/pifconfig3  Z& L. x) K( w; n  X; d7 F6 h
python3-ethtool: /usr/share/man/man8/pifconfig3.8.gz4 v* C* W  k# x7 x
python3-sphinx: /usr/lib/python3/dist-packages/sphinx/ext/ifconfig.py
% _. ?, w' I+ sruby-packetfu: /usr/share/doc/ruby-packetfu/examples/ifconfig.rb
* @4 d2 W2 z9 o) A0 \7 n( @sphinx-doc: /usr/share/doc/sphinx-doc/html/_sources/usage/extensions/ifconfig.rst.txt1 K+ w# K9 L, v
sphinx-doc: /usr/share/doc/sphinx-doc/html/usage/extensions/ifconfig.html
+ I( p7 S4 h/ U5 |+ \thefuck: /usr/share/thefuck/thefuck/rules/ifconfig_device_not_found.py
$ Y$ F6 `* W7 b6 W8 Tweevely: /usr/share/weevely/modules/net/ifconfig.py
- p4 D+ Q5 |8 Q4 f, W9 ~! Izsh-common: /usr/share/zsh/functions/Completion/Unix/_ifconfig
3 r! _: D6 k2 }
! W( ?" ?" X& W
: N2 i5 P2 O. J8 t+ l0 h- u4 B2 W; d0 p. Q5 h7 W2 j

; ~# @+ F* N5 z. Q( u' a" l. i$ E7 M& w+ I- R  ^, i. r# t  r0 l9 p

% M2 r( [( j) |
" D9 {, Z# Y9 p

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
: y2 z. ^; g8 Z3 A! h* B, a, N( o5 q% d6 v
然后你会看到那么几行。从列出来的包名和后面的绝对路径可以判断出应该安装的是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$'- f  ]- `: J8 b" {: Y, Z
net-tools: /sbin/ifconfig                 
/ h  M/ U- h' g( s/ wroot@localhost:~# apt-file search -x 'bin/rz$'. P( G, S! G! B+ _3 ]
lrzsz: /usr/bin/rz        
               
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 01:49 , Processed in 0.017176 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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