易陆发现互联网技术论坛

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

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

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

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

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

x
ubuntu 或者debian 系统查询
, }: J% s# y. t; [/ d  x4 T现在安装:/ C" I# F6 E8 S0 h
apt-get install -y apt-file
/ h/ W+ f6 i+ P8 b% @! p" G0 s6 o8 K) G' b

. d2 f: d8 l" R/ {/ D: HReading package lists... Done, Z% S) H. n% k5 |, O$ v: [  i7 [% w
Building dependency tree... Done
$ Q! X" u2 K0 t. |! B& {Reading state information... Done$ v6 }7 a; M+ N  ~3 B  C4 m% l
The following additional packages will be installed:, ~: d# }8 }2 M8 }$ j" W/ g
  libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl
7 o7 {6 m4 _+ EThe following NEW packages will be installed:
8 J0 E3 s8 j9 ^* h- S" @/ E6 e- o- E: t  apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl  _0 v% l7 K+ Q% C# ]
0 upgraded, 6 newly installed, 0 to remove and 34 not upgraded.
8 J+ t: Z5 n: v- zNeed to get 293 kB of archives.
2 x' J& y' |1 b7 P  q6 w% v2 r7 K: u4 zAfter this operation, 887 kB of additional disk space will be used.4 B# e' r5 E# `( L6 H5 E& H% a, s

+ A2 [, m9 e9 B1 U' Y4 @; M# D7 |0 k. r
% |* w$ I2 {0 l, s

# E* q, Y& f4 Z7 u% \$ jroot@ubuntu:/home/ubuntu# apt-file search vim
9 @+ z! G" D5 z  w3 i
" k" O: W$ A, b$ f7 p8 LFinding relevant cache files to search ...E: The cache is empty. You need to run "apt-file update" first.
. f* L+ r6 A" b5 ]3 {% p4 d/ \8 ?+ T* Z
执行更新:
( T! S8 Q$ b! u) }$ ~- F5 c# apt-file update. ~+ @; |0 S1 @0 ~  G. v
3 O6 h6 w8 G  E0 ~* m4 j# A9 J1 i
root@ubuntu:/home/ubuntu# apt-file update
+ f4 m2 b  I. f* N% K5 |/ J, uHit:1 http://cn.archive.ubuntu.com/ubuntu jammy InRelease  r) ?! w4 h: |% C+ J
Hit:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates InRelease* U& e7 j/ l& N( g) z& c
Hit:3 http://cn.archive.ubuntu.com/ubuntu jammy-backports InRelease. i9 |. O' z& s8 X, |  D) y% ]
Hit:4 http://cn.archive.ubuntu.com/ubuntu jammy-security InRelease
: O6 |. M& _* n2 _" C2 cGet:5 http://cn.archive.ubuntu.com/ubuntu jammy amd64 Contents (deb) [46.9 MB]- G! i$ x% D: i( [5 q4 u  ]" C
" B9 V9 v6 E( Q4 D
root@ubuntu:/home/ubuntu# ifconfig
  ^% e( Q3 A! X! D* Obash: ifconfig: command not found# P) z$ G$ C8 J* f! `' k) o
root@ubuntu:/home/ubuntu# apt-file search ifconfig + S4 J2 x! H/ v3 L0 N/ U9 w/ A
cloud-init: /usr/lib/python3/dist-packages/cloudinit/distros/parsers/ifconfig.py( V: l' R) c, y
fish-common: /usr/share/fish/completions/ifconfig.fish
! R. M6 |1 V' M8 w) P3 v) {9 {! \fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/bsd/ifconfig_interface
# g" a$ J( A3 \: Jfwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/ifconfig_interface
% X8 E- h' _6 W- V2 R5 d( c! Ufwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/rc_conf_ifconfig_interface1 R0 }# S% j- i! K2 }) z4 {0 i
grc: /usr/share/doc/grc/contrib/mrsmith/conf.ifconfig
# A$ e  K" m* d6 `4 b# K, ]: zgrc: /usr/share/grc/conf.ifconfig
( S9 w/ Q$ {2 r% N5 Cgrok: /usr/share/doc/grok/examples/ifconfig.grok5 h% I& E' y" x3 z' a3 }, o1 N$ v/ M
inetutils-tools: /usr/bin/inetutils-ifconfig
& l7 ~& w3 s- v" h# \) `inetutils-tools: /usr/share/man/man1/inetutils-ifconfig.1.gz9 `; h% B# @/ g9 w# k
jc: /usr/lib/python3/dist-packages/jc/parsers/ifconfig.py4 s  j6 S! r8 R) u/ D6 c: w
jc: /usr/share/doc/jc/parsers/ifconfig.md.gz; Q- l1 e  ~; Z  Y) v2 j
libluv-ocaml-dev: /usr/share/doc/libluv-ocaml-dev/examples/ifconfig.ml
; C: s  r( ~8 G- olibnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/changelog.Debian.gz
/ D4 g. d2 Q: f) ilibnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/copyright( B7 y+ ?+ l5 H$ w, q& A
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.sh4 j+ g& G9 V+ @8 ]1 b
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.sh. U# P$ U' k% ^# T, o
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 x9 I# [, P7 p7 Rlinux-aws-headers-5.15.0-1004: /usr/src/linux-aws-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
$ n0 A( r  f0 ?4 A/ Vlinux-aws-headers-5.15.0-1035: /usr/src/linux-aws-headers-5.15.0-1035/tools/hv/hv_set_ifconfig.sh
# e; [5 l3 e! [# E' G9 R* Z7 s" }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+ h: T4 j' r( C" S4 |" w
linux-azure-headers-5.15.0-1003: /usr/src/linux-azure-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh
/ R+ t8 ?" N! B- Q0 m  Tlinux-azure-headers-5.15.0-1037: /usr/src/linux-azure-headers-5.15.0-1037/tools/hv/hv_set_ifconfig.sh
  t9 F' u2 D1 y: M0 r, \% ]& p) a% Klinux-cloud-tools-common: /usr/sbin/hv_set_ifconfig
0 T6 Q+ j5 O7 j! w  hlinux-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' Y4 R; F% c+ D8 i6 B7 I  u
linux-gcp-headers-5.15.0-1003: /usr/src/linux-gcp-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh1 c& Y* t9 ~% n1 R4 t' f/ r
linux-gcp-headers-5.15.0-1032: /usr/src/linux-gcp-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh$ v( m; _3 K. I2 {5 ^3 \$ F8 K
linux-gke-headers-5.15.0-1002: /usr/src/linux-gke-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh& S( l/ h& u3 g" B/ E
linux-gke-headers-5.15.0-1032: /usr/src/linux-gke-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
- S" @4 W8 M/ wlinux-gkeop-headers-5.15.0-1019: /usr/src/linux-gkeop-headers-5.15.0-1019/tools/hv/hv_set_ifconfig.sh- }* j, E" n  j' r- m& e) @
linux-headers-5.15.0-25: /usr/src/linux-headers-5.15.0-25/tools/hv/hv_set_ifconfig.sh$ C: p# f; V2 T5 p. D0 w! y
linux-headers-5.15.0-71: /usr/src/linux-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh
) V/ E4 _7 c; M! ?- g/ u) b; ?) X$ Xlinux-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! `9 M4 V2 q% U7 o$ B
linux-ibm-headers-5.15.0-1002: /usr/src/linux-ibm-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
% t$ ~; F& Q- R' L+ R3 ilinux-ibm-headers-5.15.0-1029: /usr/src/linux-ibm-headers-5.15.0-1029/tools/hv/hv_set_ifconfig.sh4 p5 ^1 F5 O8 g( y" L% M* N; w
linux-intel-iotg-cloud-tools-common: /usr/sbin/hv_set_ifconfig- V1 W5 ~2 J6 P( s
linux-intel-iotg-headers-5.15.0-1004: /usr/src/linux-intel-iotg-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
  }7 G  E2 f& ^' c2 Z& Wlinux-intel-iotg-headers-5.15.0-1028: /usr/src/linux-intel-iotg-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh
" I& B. C: C9 s, S2 _9 E$ H4 g4 xlinux-kvm-headers-5.15.0-1004: /usr/src/linux-kvm-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
  B; t( y% A. b0 ]linux-kvm-headers-5.15.0-1032: /usr/src/linux-kvm-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
8 R% s0 @+ r" P4 f# K1 J* o7 Y& ?linux-lowlatency-headers-5.15.0-24: /usr/src/linux-lowlatency-headers-5.15.0-24/tools/hv/hv_set_ifconfig.sh
0 r, d: l! J9 jlinux-lowlatency-headers-5.15.0-71: /usr/src/linux-lowlatency-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh# `7 {& Y3 _" C/ a) @, b6 E
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
0 z6 I! E& b  P! a) jlinux-nvidia-5.19-cloud-tools-common: /usr/sbin/hv_set_ifconfig% }6 }- X6 n3 D/ X+ N% z% I3 [+ J* i8 C
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 [2 U7 d* d4 t  d3 ulinux-nvidia-cloud-tools-common: /usr/sbin/hv_set_ifconfig0 B* [& [% T+ ]. ^$ V5 P
linux-nvidia-headers-5.15.0-1023: /usr/src/linux-nvidia-headers-5.15.0-1023/tools/hv/hv_set_ifconfig.sh
0 l+ ^+ A4 c7 |5 G* hlinux-nvidia-tegra-headers-5.15.0-1012: /usr/src/linux-nvidia-tegra-headers-5.15.0-1012/tools/hv/hv_set_ifconfig.sh
# Y8 F0 `! _% g! [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
' o) W/ [* J5 Q. _% w2 g/ L) j. k' elinux-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! F6 n9 I: k9 X  Y" O
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.sh9 [( z* Z# W9 J: A
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
/ u$ H6 K' l0 S% _2 `/ mlinux-oracle-headers-5.15.0-1002: /usr/src/linux-oracle-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh! M- l) s, ]& H9 N8 k% k
linux-oracle-headers-5.15.0-1034: /usr/src/linux-oracle-headers-5.15.0-1034/tools/hv/hv_set_ifconfig.sh
; w! q5 F" f  ylinux-realtime-headers-5.15.0-1032: /usr/src/linux-realtime-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
9 W6 ~( C' S) Y3 \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
8 C, n' s$ n  V- f/ Glinux-riscv-headers-5.15.0-1007: /usr/src/linux-riscv-headers-5.15.0-1007/tools/hv/hv_set_ifconfig.sh, P  i5 E  z: d6 X0 [2 i
linux-riscv-headers-5.15.0-1028: /usr/src/linux-riscv-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh2 g/ S' b; b) @# Y
linux-source-5.15.0: /usr/src/linux-source-5.15.0/debian/cloud-tools/hv_set_ifconfig
! x$ y# c$ E6 I9 ?% _* V  qlinux-source-5.19.0: /usr/src/linux-source-5.19.0/debian/cloud-tools/hv_set_ifconfig
- K0 u6 R. P4 w3 dlinux-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; U8 g; ~, l6 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
( p5 A* N4 M4 a6 s& ^$ L. a' _7 \manpages-es: /usr/share/man/es/man8/ifconfig.8.gz4 N) G! z6 [* z" h6 ~/ i
manpages-ja: /usr/share/man/ja/man8/ifconfig.8.gz% S. L9 |; t5 k1 e1 V3 \2 x% J
manpages-pl: /usr/share/man/pl/man8/ifconfig.8.gz
- P- G0 g* c4 K" E4 K5 @manpages-tr: /usr/share/man/tr/man8/ifconfig.8.gz9 S& \- f: ~1 o/ }( C8 u5 j, g+ n
manpages-zh: /usr/share/man/zh_CN/man8/ifconfig.8.gz
4 d. o" o. u3 mmanpages-zh: /usr/share/man/zh_TW/man8/ifconfig.8.gz, t0 w6 B( A+ r* U8 @
net-tools: /sbin/ifconfig7 H4 Q1 r2 D% D3 x% [# m
net-tools: /usr/share/man/de/man8/ifconfig.8.gz; S8 W5 q) ^0 d# ^' r7 l
net-tools: /usr/share/man/fr/man8/ifconfig.8.gz) a4 u9 f" I, P4 _, ?) F! b
net-tools: /usr/share/man/man8/ifconfig.8.gz
  u6 u3 C7 q; J+ _. J& ~* C8 [% bnet-tools: /usr/share/man/pt_BR/man8/ifconfig.8.gz
9 T) J1 j8 J6 g5 W2 U  U$ ipython-psutil-doc: /usr/share/doc/python-psutil-doc/examples/ifconfig.py
( V) T5 y3 d3 \+ mpython3-ethtool: /usr/sbin/pifconfig3$ l2 Q, |' T1 m; _
python3-ethtool: /usr/share/man/man8/pifconfig3.8.gz
% s* m6 e. i4 w  q- [python3-sphinx: /usr/lib/python3/dist-packages/sphinx/ext/ifconfig.py3 P, K* }% Q' ~- B
ruby-packetfu: /usr/share/doc/ruby-packetfu/examples/ifconfig.rb
" z1 P* L! j. Zsphinx-doc: /usr/share/doc/sphinx-doc/html/_sources/usage/extensions/ifconfig.rst.txt
& E* N! D% q+ [5 c# Esphinx-doc: /usr/share/doc/sphinx-doc/html/usage/extensions/ifconfig.html
. a( A- f+ |' j" u  ^, \+ t( wthefuck: /usr/share/thefuck/thefuck/rules/ifconfig_device_not_found.py* U8 ^7 V; X; ?, p
weevely: /usr/share/weevely/modules/net/ifconfig.py
1 }) T. x" N( x0 q8 o1 E5 Rzsh-common: /usr/share/zsh/functions/Completion/Unix/_ifconfig
( e4 D3 x% _. S! C9 s, r& m. ^4 W8 P/ M7 B5 S- Z
! B8 X0 Z* c; G5 E

& Q( x& d8 @/ }* w; _" ^9 E% ?) N/ j4 X% h! @
! G1 x1 d- I! i0 w+ ~2 \

, D# \  F' X3 H
# H: A: v1 q4 O
 楼主| 发表于 2023-5-12 22:58:30 | 显示全部楼层
apt install -y apt-file && apt-file update && apt-file search netstat |grep bin* M. E9 K' V$ Y; k6 A/ {
+ f" m; L2 L& t! Y% p# P  k
然后你会看到那么几行。从列出来的包名和后面的绝对路径可以判断出应该安装的是net-tools包,所以执行apt install -y net-tools
 楼主| 发表于 2023-5-12 23:26:32 | 显示全部楼层
root@localhost:~# apt-file search -x 'bin/ifconfig$'# f. J; W6 e4 R" F5 L3 V" y" U
net-tools: /sbin/ifconfig                 
: ^+ w% ~6 f# I+ Q) y: ]root@localhost:~# apt-file search -x 'bin/rz$'
' b" g, Y! K! N' {$ N4 h  ~lrzsz: /usr/bin/rz        
               
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

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

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

GMT+8, 2026-4-8 21:41 , Processed in 0.046487 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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