易陆发现互联网技术论坛

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

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

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

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

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

x
ubuntu 或者debian 系统查询
% r4 Q4 @. G: o) k  }现在安装:8 D5 O! _+ s' M- f/ H- ]
apt-get install -y apt-file; E  H7 N5 u$ M( h: k
1 W3 \( ]' x3 e
4 I4 \( p% A! c3 n5 u6 s# m# W
Reading package lists... Done
* x" P  }' P% O" U" b7 [Building dependency tree... Done
1 U8 E2 f% H; h7 ]1 p9 zReading state information... Done9 c5 X; @8 \9 q3 p( o
The following additional packages will be installed:
" N0 g) z( p) K, {6 b# h6 r  libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl) c0 \4 j) \% S( M9 J
The following NEW packages will be installed:
" Q* v" n# v8 M; c7 c  apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl" @% [' {4 R+ N
0 upgraded, 6 newly installed, 0 to remove and 34 not upgraded.
  X& E5 t" W. N+ [" V: c$ I/ n, ?Need to get 293 kB of archives.
4 l" Q" |8 G* u' MAfter this operation, 887 kB of additional disk space will be used., v) D  M* F) g0 \

* F+ `9 T3 w! ?% m# R( n; F$ A# T! m! f. \- o8 M; {! S. P7 n

$ p3 U* l, \. D5 w4 d' N9 A6 q5 m9 B) P
root@ubuntu:/home/ubuntu# apt-file search vim
; a2 t  [! O2 j: d, |" [% ]. Y; L
9 B9 ~3 |. b/ H- d! u; bFinding relevant cache files to search ...E: The cache is empty. You need to run "apt-file update" first.7 M5 x6 t' M' n" ?4 L, z7 Z+ q
! H3 f; q( D' B. T, @, A
执行更新:5 B; ]# O5 b( l6 Z1 l$ x  W3 q
# apt-file update
& }$ T, E$ Z* q% m' ?) e; ~/ X2 o" t) `9 r8 T
root@ubuntu:/home/ubuntu# apt-file update
+ j, H6 v4 `% e0 g8 kHit:1 http://cn.archive.ubuntu.com/ubuntu jammy InRelease
+ c1 ^% z3 L: t5 ^5 }! PHit:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates InRelease
* [' Q" R' `: I; D8 ]  d7 Z* [  `Hit:3 http://cn.archive.ubuntu.com/ubuntu jammy-backports InRelease
1 t# m; J7 M" [) z; i; K& UHit:4 http://cn.archive.ubuntu.com/ubuntu jammy-security InRelease6 m% g, O5 l$ W5 E! v& Q
Get:5 http://cn.archive.ubuntu.com/ubuntu jammy amd64 Contents (deb) [46.9 MB]) P8 d4 \, l$ C* q6 D# l, s+ y
3 Y& K, s, w! Y. z( r
root@ubuntu:/home/ubuntu# ifconfig
# }' N  q7 N, b$ L) k! Nbash: ifconfig: command not found+ m) A. y+ h0 S
root@ubuntu:/home/ubuntu# apt-file search ifconfig 4 T1 i7 x7 }! A2 G8 l
cloud-init: /usr/lib/python3/dist-packages/cloudinit/distros/parsers/ifconfig.py
8 R& e& J& ^, F3 H( vfish-common: /usr/share/fish/completions/ifconfig.fish$ t0 X  U. u/ R, J& t$ M5 _/ }7 p
fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/bsd/ifconfig_interface2 k: h- r+ b8 q( d
fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/ifconfig_interface
2 c9 ]. X( _  H4 g/ t! I* Qfwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/rc_conf_ifconfig_interface1 c  G& g$ m' [4 k( u2 T
grc: /usr/share/doc/grc/contrib/mrsmith/conf.ifconfig
# m6 m1 ~. C( O% f3 Y! G$ |grc: /usr/share/grc/conf.ifconfig- Q! G7 N/ \1 y9 B: F3 j
grok: /usr/share/doc/grok/examples/ifconfig.grok
) F: q& m  o5 F, I! kinetutils-tools: /usr/bin/inetutils-ifconfig
/ b+ Q  J  g! }inetutils-tools: /usr/share/man/man1/inetutils-ifconfig.1.gz1 G' u9 B9 C/ w! l9 Y
jc: /usr/lib/python3/dist-packages/jc/parsers/ifconfig.py
& I" w+ `& n6 m! a( Hjc: /usr/share/doc/jc/parsers/ifconfig.md.gz
; @& B" P) v% ~2 `- ~& `3 Qlibluv-ocaml-dev: /usr/share/doc/libluv-ocaml-dev/examples/ifconfig.ml! ~$ \3 j8 n9 R/ T
libnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/changelog.Debian.gz
8 _' |0 ^+ {6 u  y% N) dlibnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/copyright
: R! j" o( H  Q. ^+ Z" ^: Ylinux-allwinner-5.17-headers-5.17.0-1010: /usr/src/linux-allwinner-5.17-headers-5.17.0-1010/tools/hv/hv_set_ifconfig.sh1 ^2 r/ ]' n9 Y
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
3 a; q9 ~9 U' p$ Nlinux-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  }& r8 m' Q" O( C; [. T
linux-aws-headers-5.15.0-1004: /usr/src/linux-aws-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
( W8 K+ N9 U- \) |linux-aws-headers-5.15.0-1035: /usr/src/linux-aws-headers-5.15.0-1035/tools/hv/hv_set_ifconfig.sh( W! P+ w* M2 s) C: D# C
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  y5 N7 C0 V' G& h6 X  N8 U
linux-azure-headers-5.15.0-1003: /usr/src/linux-azure-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh
; o4 B+ U/ H' Mlinux-azure-headers-5.15.0-1037: /usr/src/linux-azure-headers-5.15.0-1037/tools/hv/hv_set_ifconfig.sh
3 S8 P+ S9 X9 n- ylinux-cloud-tools-common: /usr/sbin/hv_set_ifconfig
5 }4 O# W4 w8 f9 F5 rlinux-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
# e* i/ v& H8 z& k- ~6 r. Plinux-gcp-headers-5.15.0-1003: /usr/src/linux-gcp-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh
# R; A0 Y! C) n& Ylinux-gcp-headers-5.15.0-1032: /usr/src/linux-gcp-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh! f) J( D7 L9 ?, F8 M
linux-gke-headers-5.15.0-1002: /usr/src/linux-gke-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
6 _. H7 Y% i7 j4 q6 K9 n* qlinux-gke-headers-5.15.0-1032: /usr/src/linux-gke-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh+ ~4 q, q& x; d9 M, N
linux-gkeop-headers-5.15.0-1019: /usr/src/linux-gkeop-headers-5.15.0-1019/tools/hv/hv_set_ifconfig.sh3 x, V% Q. V/ W, g+ V: C* a; w
linux-headers-5.15.0-25: /usr/src/linux-headers-5.15.0-25/tools/hv/hv_set_ifconfig.sh* ?( u9 @3 X& z6 i
linux-headers-5.15.0-71: /usr/src/linux-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh* f0 U$ U) e! W/ h- C: h
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, i5 X/ m& y! ?! V2 n' r" ^% X
linux-ibm-headers-5.15.0-1002: /usr/src/linux-ibm-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
/ m& y# F" k5 e! |/ c2 s. ~linux-ibm-headers-5.15.0-1029: /usr/src/linux-ibm-headers-5.15.0-1029/tools/hv/hv_set_ifconfig.sh8 f0 z; O3 X' M0 j9 b- C4 P
linux-intel-iotg-cloud-tools-common: /usr/sbin/hv_set_ifconfig7 c" K+ H! A, E  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+ w2 p0 y0 `3 u$ ]' 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! d& W& q# X- ~# g5 ^* W) c
linux-kvm-headers-5.15.0-1004: /usr/src/linux-kvm-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh! j% E/ ~# k( n! L
linux-kvm-headers-5.15.0-1032: /usr/src/linux-kvm-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
5 e! b' c, U. @" ^7 Y- m8 d& i7 llinux-lowlatency-headers-5.15.0-24: /usr/src/linux-lowlatency-headers-5.15.0-24/tools/hv/hv_set_ifconfig.sh7 _! Q- G1 K# a8 o% J2 p8 Z0 Z& B
linux-lowlatency-headers-5.15.0-71: /usr/src/linux-lowlatency-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh
/ ^3 j' C: J  r; f8 ^# W  v" Alinux-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) Y7 r2 g: d+ Z
linux-nvidia-5.19-cloud-tools-common: /usr/sbin/hv_set_ifconfig
: ?- k( i( l% |+ o# \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.sh0 ]) b  r$ G6 i
linux-nvidia-cloud-tools-common: /usr/sbin/hv_set_ifconfig
1 M. ], {2 l% n( o# Ulinux-nvidia-headers-5.15.0-1023: /usr/src/linux-nvidia-headers-5.15.0-1023/tools/hv/hv_set_ifconfig.sh
; I) L: G1 r- l1 R( H5 ^linux-nvidia-tegra-headers-5.15.0-1012: /usr/src/linux-nvidia-tegra-headers-5.15.0-1012/tools/hv/hv_set_ifconfig.sh
) a( }% X, M; ]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
% E4 o% p5 r) y2 f3 v- m# h7 Ulinux-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' X' I3 \% s" q
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
1 o+ O# F+ N8 z8 U! `1 D7 C3 R' [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- q4 c( {! a
linux-oracle-headers-5.15.0-1002: /usr/src/linux-oracle-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
) z8 o5 P* ^, @linux-oracle-headers-5.15.0-1034: /usr/src/linux-oracle-headers-5.15.0-1034/tools/hv/hv_set_ifconfig.sh
6 c- e( P* Z2 c( olinux-realtime-headers-5.15.0-1032: /usr/src/linux-realtime-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh" |) N* C' R) f1 x
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' l6 C' q! d$ J: a& R  I
linux-riscv-headers-5.15.0-1007: /usr/src/linux-riscv-headers-5.15.0-1007/tools/hv/hv_set_ifconfig.sh
- E2 u+ W! X, Xlinux-riscv-headers-5.15.0-1028: /usr/src/linux-riscv-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh
5 z5 i% Y+ S! ?7 Hlinux-source-5.15.0: /usr/src/linux-source-5.15.0/debian/cloud-tools/hv_set_ifconfig. u  X- W; @; r2 w$ L
linux-source-5.19.0: /usr/src/linux-source-5.19.0/debian/cloud-tools/hv_set_ifconfig% Q9 i" L/ X1 ^; W2 T" t
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.sh0 {8 F' n; |, C9 G3 B
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
. e2 n6 M) [' L; fmanpages-es: /usr/share/man/es/man8/ifconfig.8.gz
7 E6 ]1 D" _* m0 N5 ]manpages-ja: /usr/share/man/ja/man8/ifconfig.8.gz
. G$ Y6 I' Z4 o! P& bmanpages-pl: /usr/share/man/pl/man8/ifconfig.8.gz0 L" i6 |  r  Q% |$ _4 P
manpages-tr: /usr/share/man/tr/man8/ifconfig.8.gz& c4 d+ {  e! [6 B3 p4 W0 |' c
manpages-zh: /usr/share/man/zh_CN/man8/ifconfig.8.gz3 f- A9 R4 O1 g) P- B* a
manpages-zh: /usr/share/man/zh_TW/man8/ifconfig.8.gz# k( x. Z+ t9 K, ~
net-tools: /sbin/ifconfig
% `% s* X( b. w& L- P; z4 |* ~net-tools: /usr/share/man/de/man8/ifconfig.8.gz
, e- @- v) B7 `net-tools: /usr/share/man/fr/man8/ifconfig.8.gz
# b) w0 ?7 Y3 q8 Q1 ?- znet-tools: /usr/share/man/man8/ifconfig.8.gz
; n% q- ?" U" }2 r# S7 e3 @net-tools: /usr/share/man/pt_BR/man8/ifconfig.8.gz$ ~7 y! Q9 |- e  S
python-psutil-doc: /usr/share/doc/python-psutil-doc/examples/ifconfig.py
& ]9 a( w$ y+ Fpython3-ethtool: /usr/sbin/pifconfig3
+ N! q# P5 b$ z; X. Y% i8 b9 }- `python3-ethtool: /usr/share/man/man8/pifconfig3.8.gz3 `9 |- i3 p" r* W% J) {
python3-sphinx: /usr/lib/python3/dist-packages/sphinx/ext/ifconfig.py6 W8 J- K1 O' e' G
ruby-packetfu: /usr/share/doc/ruby-packetfu/examples/ifconfig.rb
8 r) a. f5 ~9 T0 |, T# bsphinx-doc: /usr/share/doc/sphinx-doc/html/_sources/usage/extensions/ifconfig.rst.txt
, T8 ]6 y6 P, s' L: v+ vsphinx-doc: /usr/share/doc/sphinx-doc/html/usage/extensions/ifconfig.html" W4 o6 |% n, n5 _3 L6 f7 q
thefuck: /usr/share/thefuck/thefuck/rules/ifconfig_device_not_found.py3 a  C2 ?, S# ]! |
weevely: /usr/share/weevely/modules/net/ifconfig.py
. \+ |: u. z/ nzsh-common: /usr/share/zsh/functions/Completion/Unix/_ifconfig
9 |% U& z4 ^* f2 L# W5 L/ ]' V. a  _/ `

9 _" w7 ~! f, w8 j( l. ~9 e( z, ?; X# a6 ]5 a4 D
9 C" |7 i6 z: L5 D$ N

# z' [6 F# e" Y' x& X
6 w' q; `5 {) ?$ ]" r# |( E& ?6 C# F8 X: R0 {
 楼主| 发表于 2023-5-12 22:58:30 | 显示全部楼层
apt install -y apt-file && apt-file update && apt-file search netstat |grep bin
9 {- W& ?9 K* i6 f8 K6 q
$ P9 E# w) ^* p8 ~/ a7 X然后你会看到那么几行。从列出来的包名和后面的绝对路径可以判断出应该安装的是net-tools包,所以执行apt install -y net-tools
 楼主| 发表于 2023-5-12 23:26:32 | 显示全部楼层
root@localhost:~# apt-file search -x 'bin/ifconfig$'
2 w3 g9 E6 H$ M2 }( p! [# jnet-tools: /sbin/ifconfig                 
( e# y& h0 z8 X: J# l" t& droot@localhost:~# apt-file search -x 'bin/rz$'
; E7 R* i: K* H& ulrzsz: /usr/bin/rz        
               
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

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

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

GMT+8, 2026-4-8 21:30 , Processed in 0.071287 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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