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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-5-12 22:57:43 | 显示全部楼层 |阅读模式
ubuntu 或者debian 系统查询
, Y0 @6 i4 f: |, U' q; V. B现在安装:7 h: F& `! m- W$ J' o: R
apt-get install -y apt-file1 `8 _: o7 T+ Y1 ^
2 N" m; W5 _, T, r" Y/ Q% d' Q$ d

$ B; W- t1 W9 N) O; pReading package lists... Done5 C+ |9 u$ u2 v# o8 P: P/ Z' p, b
Building dependency tree... Done
, I4 Y8 g7 n0 m- c- f7 Z- wReading state information... Done
; W* H* G. i1 R9 X2 c# KThe following additional packages will be installed:
# |- u0 L( D+ ~; @8 v  libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl/ r7 D/ U+ I  \! V' r& g* K3 ]4 a
The following NEW packages will be installed:
% G! `1 O, I/ B& \4 k  apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl
2 J5 p) [' h* [$ K0 upgraded, 6 newly installed, 0 to remove and 34 not upgraded.
6 `  A9 ?* g# f8 I# dNeed to get 293 kB of archives.
3 c( W) F  P7 Y# wAfter this operation, 887 kB of additional disk space will be used.8 P$ g% b, \+ b+ F; ^1 ~: C3 o! [
  s: ?! L  \, P, I. v

) N! _7 W9 x7 O% M$ t& E) \# d! Q6 P% ^5 ]" [$ c. F0 V" I
0 n% s. v0 E6 R. F! j0 H2 b6 M9 T
root@ubuntu:/home/ubuntu# apt-file search vim + O+ b; p4 ]9 i  \; V

$ G8 F2 l% R, [# K; s& tFinding relevant cache files to search ...E: The cache is empty. You need to run "apt-file update" first.
. n3 ^5 ^6 `/ ^1 Q7 j
6 m6 G: Z" _3 _0 S! x2 X' v6 @# A7 M执行更新:
3 `; z' M; P7 m$ N# apt-file update: f$ O. d) R0 I+ A
: u7 |1 ^! }) X$ M3 d; X6 v2 g
root@ubuntu:/home/ubuntu# apt-file update
0 D  C6 x; A  F8 xHit:1 http://cn.archive.ubuntu.com/ubuntu jammy InRelease4 ?: M' {0 N. u1 a( ]
Hit:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates InRelease
7 h* H8 G0 j, ~8 U; T9 _4 pHit:3 http://cn.archive.ubuntu.com/ubuntu jammy-backports InRelease
7 D+ h6 P, n4 o. M5 F- eHit:4 http://cn.archive.ubuntu.com/ubuntu jammy-security InRelease# I! n$ I! j8 L' i
Get:5 http://cn.archive.ubuntu.com/ubuntu jammy amd64 Contents (deb) [46.9 MB]3 t; `# L, P, a  p" }- F% g! g6 K

' o0 ]5 L  o2 i+ groot@ubuntu:/home/ubuntu# ifconfig
  M# ~6 ?; ?; Lbash: ifconfig: command not found2 z3 B0 Z, I5 ^- k
root@ubuntu:/home/ubuntu# apt-file search ifconfig
! Y+ H& S6 r8 o0 [1 Dcloud-init: /usr/lib/python3/dist-packages/cloudinit/distros/parsers/ifconfig.py  P6 `/ v0 h! S7 C$ {
fish-common: /usr/share/fish/completions/ifconfig.fish5 D3 u; N& X9 h" D* J( _
fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/bsd/ifconfig_interface
6 y$ @  u- H. l* G7 v9 kfwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/ifconfig_interface4 W6 a, O% o3 D2 Z9 F
fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/rc_conf_ifconfig_interface7 f: q8 d5 j: d8 _, r
grc: /usr/share/doc/grc/contrib/mrsmith/conf.ifconfig
' ^& L3 S; I0 xgrc: /usr/share/grc/conf.ifconfig
2 h: ~7 _9 J) D; N! tgrok: /usr/share/doc/grok/examples/ifconfig.grok% B; L6 n2 o# V- e* h* G  y( w
inetutils-tools: /usr/bin/inetutils-ifconfig
" H& W* e6 l: |  Z2 ainetutils-tools: /usr/share/man/man1/inetutils-ifconfig.1.gz
9 q2 ^+ v& l- l: r2 fjc: /usr/lib/python3/dist-packages/jc/parsers/ifconfig.py
& ]/ f6 g( Y) ~" [/ Ejc: /usr/share/doc/jc/parsers/ifconfig.md.gz
4 G; b- f* B0 N9 _* j; ~4 m/ Flibluv-ocaml-dev: /usr/share/doc/libluv-ocaml-dev/examples/ifconfig.ml2 V! a1 i: O9 t& Q+ F- {7 P1 I4 B8 Z
libnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/changelog.Debian.gz
. R0 v; C" s1 z: g  G0 s( }7 Rlibnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/copyright0 N  a4 W9 Z1 U0 S: L
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
2 ^* h' \% o, A, |8 ?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
& n% f" j+ j" V, A- C/ alinux-aws-5.19-headers-5.19.0-1024: /usr/src/linux-aws-5.19-headers-5.19.0-1024/tools/hv/hv_set_ifconfig.sh6 O+ w" n) A. m9 K/ \
linux-aws-headers-5.15.0-1004: /usr/src/linux-aws-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh  O! K, I# A3 \7 A8 ?8 w- f4 N
linux-aws-headers-5.15.0-1035: /usr/src/linux-aws-headers-5.15.0-1035/tools/hv/hv_set_ifconfig.sh/ B8 [1 I6 L4 B9 D
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.sh2 n0 Y0 f* B( w( y
linux-azure-headers-5.15.0-1003: /usr/src/linux-azure-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh& y% E& [. [# @0 ^4 `& _
linux-azure-headers-5.15.0-1037: /usr/src/linux-azure-headers-5.15.0-1037/tools/hv/hv_set_ifconfig.sh; V. l( G+ e9 w/ D
linux-cloud-tools-common: /usr/sbin/hv_set_ifconfig
1 k6 r6 S1 Q8 ]' W' Alinux-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; ~" M! I4 K8 ]8 k4 Z# v: Y
linux-gcp-headers-5.15.0-1003: /usr/src/linux-gcp-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh" j1 n2 l$ R: a0 q3 Z7 `
linux-gcp-headers-5.15.0-1032: /usr/src/linux-gcp-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
+ H, b5 f9 |2 k: Rlinux-gke-headers-5.15.0-1002: /usr/src/linux-gke-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh( @- R4 @* A( Z+ W
linux-gke-headers-5.15.0-1032: /usr/src/linux-gke-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh- C' y+ I1 W# V/ u
linux-gkeop-headers-5.15.0-1019: /usr/src/linux-gkeop-headers-5.15.0-1019/tools/hv/hv_set_ifconfig.sh; Z9 L2 q: ?" G5 ~5 U( ?
linux-headers-5.15.0-25: /usr/src/linux-headers-5.15.0-25/tools/hv/hv_set_ifconfig.sh
/ R9 i# Y* e; w+ I0 elinux-headers-5.15.0-71: /usr/src/linux-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh1 M% n0 a5 S$ {' g
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) U* c2 E( ?6 b' H; j+ ]' C
linux-ibm-headers-5.15.0-1002: /usr/src/linux-ibm-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
3 T4 G/ `" Y/ q+ B/ q1 U) blinux-ibm-headers-5.15.0-1029: /usr/src/linux-ibm-headers-5.15.0-1029/tools/hv/hv_set_ifconfig.sh
) L* t5 f) _- }9 J) Alinux-intel-iotg-cloud-tools-common: /usr/sbin/hv_set_ifconfig# q2 Z3 W& P8 o% Q' {1 {; a
linux-intel-iotg-headers-5.15.0-1004: /usr/src/linux-intel-iotg-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
1 V7 T4 S7 O: ^9 y9 blinux-intel-iotg-headers-5.15.0-1028: /usr/src/linux-intel-iotg-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh
5 g3 k/ W3 Q9 l) x7 l; V( u( Zlinux-kvm-headers-5.15.0-1004: /usr/src/linux-kvm-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
: I( r& k1 R+ H3 v1 d' tlinux-kvm-headers-5.15.0-1032: /usr/src/linux-kvm-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh7 T$ o+ {# [: u) b! I5 F8 `
linux-lowlatency-headers-5.15.0-24: /usr/src/linux-lowlatency-headers-5.15.0-24/tools/hv/hv_set_ifconfig.sh
5 ]9 Q9 \5 E% r* dlinux-lowlatency-headers-5.15.0-71: /usr/src/linux-lowlatency-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh  h& r: V5 q- _
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$ [* z) y' R& ?4 N0 H
linux-nvidia-5.19-cloud-tools-common: /usr/sbin/hv_set_ifconfig
) u$ h5 z" O. 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
' I! |5 S+ z/ {linux-nvidia-cloud-tools-common: /usr/sbin/hv_set_ifconfig
3 B2 G( t2 `2 O) G" m& E, @" `! hlinux-nvidia-headers-5.15.0-1023: /usr/src/linux-nvidia-headers-5.15.0-1023/tools/hv/hv_set_ifconfig.sh
2 W8 o% C) d# J( |, clinux-nvidia-tegra-headers-5.15.0-1012: /usr/src/linux-nvidia-tegra-headers-5.15.0-1012/tools/hv/hv_set_ifconfig.sh, [9 P# E1 I0 U% e
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
# W, |! B5 w0 W% O5 W$ Jlinux-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
) B3 {: r0 X$ M7 ^. k" nlinux-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, A9 \9 g/ r6 r# G" s1 j* Q) p( U; S
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
: S' N8 W$ _* @7 g; Hlinux-oracle-headers-5.15.0-1002: /usr/src/linux-oracle-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh9 ]$ q" q4 B3 W+ Y4 F
linux-oracle-headers-5.15.0-1034: /usr/src/linux-oracle-headers-5.15.0-1034/tools/hv/hv_set_ifconfig.sh
# J6 T1 h5 D2 F1 c, Zlinux-realtime-headers-5.15.0-1032: /usr/src/linux-realtime-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
4 N5 P: x0 v7 f! alinux-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 l& z3 \+ |" n1 j- U( Elinux-riscv-headers-5.15.0-1007: /usr/src/linux-riscv-headers-5.15.0-1007/tools/hv/hv_set_ifconfig.sh
. m& U! K% x8 e' ]1 H" l& _  Plinux-riscv-headers-5.15.0-1028: /usr/src/linux-riscv-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh
1 M# C3 o) q# xlinux-source-5.15.0: /usr/src/linux-source-5.15.0/debian/cloud-tools/hv_set_ifconfig
$ W7 H- `2 |" ~9 f7 Olinux-source-5.19.0: /usr/src/linux-source-5.19.0/debian/cloud-tools/hv_set_ifconfig
1 e" U" r1 q. U2 u# V3 Clinux-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, Y! ]: u2 ~; n" e" n
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
1 I, ^+ F7 _, G& D4 r! \manpages-es: /usr/share/man/es/man8/ifconfig.8.gz
1 _5 y  }  Z, K: mmanpages-ja: /usr/share/man/ja/man8/ifconfig.8.gz
9 S5 e* }7 L. ?& h7 I9 omanpages-pl: /usr/share/man/pl/man8/ifconfig.8.gz
: Y2 z) l9 O* H) R% f# p) x  |$ hmanpages-tr: /usr/share/man/tr/man8/ifconfig.8.gz
/ p) ?$ ]4 `# ~, H0 x3 i5 D8 bmanpages-zh: /usr/share/man/zh_CN/man8/ifconfig.8.gz9 i2 \, _, m' `' i
manpages-zh: /usr/share/man/zh_TW/man8/ifconfig.8.gz, \3 n1 e" _' y* H" h7 P
net-tools: /sbin/ifconfig
- q; r; U$ J/ |3 P$ ynet-tools: /usr/share/man/de/man8/ifconfig.8.gz
, f* q' `  A  F* @# K1 {: S: Z+ Onet-tools: /usr/share/man/fr/man8/ifconfig.8.gz8 t8 G4 X, r: W0 _
net-tools: /usr/share/man/man8/ifconfig.8.gz
, w. ]5 G" h6 |5 y( t, }3 lnet-tools: /usr/share/man/pt_BR/man8/ifconfig.8.gz: D* @& A0 f7 Z+ P
python-psutil-doc: /usr/share/doc/python-psutil-doc/examples/ifconfig.py( b0 y% u! {( |7 z' X1 r; @$ f
python3-ethtool: /usr/sbin/pifconfig3
+ S) I$ v! u$ }5 w2 A0 xpython3-ethtool: /usr/share/man/man8/pifconfig3.8.gz9 h" U" {6 R7 O( o# w
python3-sphinx: /usr/lib/python3/dist-packages/sphinx/ext/ifconfig.py. P/ E1 t) G( n" s/ s0 }& K
ruby-packetfu: /usr/share/doc/ruby-packetfu/examples/ifconfig.rb* C0 Q/ R' c! F" s& a: F& D  S
sphinx-doc: /usr/share/doc/sphinx-doc/html/_sources/usage/extensions/ifconfig.rst.txt* y  g6 u. C- D& t
sphinx-doc: /usr/share/doc/sphinx-doc/html/usage/extensions/ifconfig.html
0 e- {) |% n5 h5 r0 ythefuck: /usr/share/thefuck/thefuck/rules/ifconfig_device_not_found.py
& c% m! k3 m8 b6 a( |7 Nweevely: /usr/share/weevely/modules/net/ifconfig.py7 Z' }( d# u+ V
zsh-common: /usr/share/zsh/functions/Completion/Unix/_ifconfig5 p9 Z8 d/ j' \7 ]4 s

1 v1 H' t$ c$ I# @/ `3 X2 p" X) T, b8 N
9 w: M( i' @6 i. c% h- o' Z
( T* m1 s' F7 A; I% r& O
- G! {/ k  ^0 i5 D2 E0 [* X  Z' d
. y3 y) \9 l7 F  K3 M( D

: E& s* a; u6 G. \2 E; `1 C4 {

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) y9 W0 _' k7 Z% y" O0 s. N9 t2 b
7 c! X. ^6 x& 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$'
: O1 a' h; Z/ R% b2 u' l( Rnet-tools: /sbin/ifconfig                 
  b* X2 S3 Q1 I$ vroot@localhost:~# apt-file search -x 'bin/rz$'
( z" a5 S- r( ~2 y. `lrzsz: /usr/bin/rz        
               
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 04:07 , Processed in 0.015918 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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