易陆发现互联网技术论坛

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

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

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

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

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

x
ubuntu 或者debian 系统查询
. ]3 g& e5 m: E8 ^( Y4 R现在安装:" L& X# \, Z. [, x% Q9 ?' P
apt-get install -y apt-file$ E) |( p3 L' F. O5 M' O/ g6 }) n
' q* w" l# C0 ]  \. w& j) m

7 w& Z4 N! T- i- F0 nReading package lists... Done3 F- E# g6 W0 \: j0 U; ^
Building dependency tree... Done
- {8 V$ ?* \/ t- K0 F7 |8 i. FReading state information... Done( ?1 E6 z, K0 u: i; r& F, I
The following additional packages will be installed:
: |% ?. S3 \3 Y' t: j  libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl0 q  k0 B; R/ {' D, A" W- y8 h/ W
The following NEW packages will be installed:
( \  d! W; `7 v  apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl liblist-moreutils-xs-perl libregexp-assemble-perl3 g6 H. q% P5 U
0 upgraded, 6 newly installed, 0 to remove and 34 not upgraded.- G; y% j, {& k9 H9 @4 u3 L+ m" Q
Need to get 293 kB of archives.
  p1 L' O, C7 Y! ~( yAfter this operation, 887 kB of additional disk space will be used.
) s0 P1 [. O6 U' `4 Y* B; I7 X
% o; K+ \, X2 D7 H/ C: X, j% }3 q. z( N* i1 H9 K% [1 T2 P% f( k$ q

% ^  Q2 G# R2 _2 h, q& E# U/ t' h" Z, h$ r# M
root@ubuntu:/home/ubuntu# apt-file search vim " u8 }5 @* b. p. G; v; i
! E) |+ ?, l! r
Finding relevant cache files to search ...E: The cache is empty. You need to run "apt-file update" first.* r0 b1 m1 y# s! O3 D- `- _5 |5 f2 m

1 G# g% L6 h3 Y执行更新:+ T# f- X5 k& T) l
# apt-file update
( [- O' z* M1 i+ _1 C9 Z+ C$ y% h/ c6 I! v& ^
root@ubuntu:/home/ubuntu# apt-file update: i0 z5 @- H( M
Hit:1 http://cn.archive.ubuntu.com/ubuntu jammy InRelease
( V/ ^( M2 d& x5 e- j8 ]( ZHit:2 http://cn.archive.ubuntu.com/ubuntu jammy-updates InRelease" w& Y# m" |6 S* T" @+ m
Hit:3 http://cn.archive.ubuntu.com/ubuntu jammy-backports InRelease2 d1 i+ i- W5 ]
Hit:4 http://cn.archive.ubuntu.com/ubuntu jammy-security InRelease3 {8 h8 }9 W+ J& X
Get:5 http://cn.archive.ubuntu.com/ubuntu jammy amd64 Contents (deb) [46.9 MB]
/ P: O2 k( \8 C* y6 a, b: |2 x* y; q/ H9 F: ~4 P1 @
root@ubuntu:/home/ubuntu# ifconfig
5 t& B% j' `5 {0 @$ p2 ]bash: ifconfig: command not found2 {% D. ]) N. }, t1 Q( N; W) w
root@ubuntu:/home/ubuntu# apt-file search ifconfig
6 X( O7 B) E! y" rcloud-init: /usr/lib/python3/dist-packages/cloudinit/distros/parsers/ifconfig.py
/ u9 Q8 m5 Z# G' N8 _fish-common: /usr/share/fish/completions/ifconfig.fish
* f9 D- q& \  L3 _6 o5 z2 bfwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/bsd/ifconfig_interface
( @' I8 z$ ]. I3 h: l. u7 d4 c+ @fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/ifconfig_interface8 k! A# u2 ^8 w9 I
fwbuilder-common: /usr/share/fwbuilder-5.3.7/configlets/freebsd/rc_conf_ifconfig_interface: Y5 c% E6 c7 [
grc: /usr/share/doc/grc/contrib/mrsmith/conf.ifconfig
% a4 K1 O" B7 _5 W' f* A( ]" Y. C, wgrc: /usr/share/grc/conf.ifconfig
4 a/ n( l! `2 K& p* g- z8 Qgrok: /usr/share/doc/grok/examples/ifconfig.grok
' I- _! W5 e  d- z" }inetutils-tools: /usr/bin/inetutils-ifconfig3 h0 p4 I0 m' a" b
inetutils-tools: /usr/share/man/man1/inetutils-ifconfig.1.gz
* y  [+ |( a0 A7 z4 ]jc: /usr/lib/python3/dist-packages/jc/parsers/ifconfig.py
+ |. ^" n* c8 f6 T& P* ]" pjc: /usr/share/doc/jc/parsers/ifconfig.md.gz
- r  R1 o: T- `7 plibluv-ocaml-dev: /usr/share/doc/libluv-ocaml-dev/examples/ifconfig.ml
: V9 D+ X# C- ?( slibnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/changelog.Debian.gz
& E+ i  w$ _- Ylibnet-ifconfig-wrapper-perl: /usr/share/doc/libnet-ifconfig-wrapper-perl/copyright
; K" G8 }  u2 w/ K5 {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  b( G* X2 W& V* x
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
* [) K: @; O( W! s( elinux-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) f& o. m* C3 y; `) O( j2 \( n
linux-aws-headers-5.15.0-1004: /usr/src/linux-aws-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh' `9 i+ O7 \$ @5 L6 J
linux-aws-headers-5.15.0-1035: /usr/src/linux-aws-headers-5.15.0-1035/tools/hv/hv_set_ifconfig.sh
: v. A& E, D# f# ~( b: R" n- Ilinux-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# Q$ j+ E6 o$ T- f( e( H: X8 q, q
linux-azure-headers-5.15.0-1003: /usr/src/linux-azure-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh
8 o1 z2 G8 w: P( c& {( V# ilinux-azure-headers-5.15.0-1037: /usr/src/linux-azure-headers-5.15.0-1037/tools/hv/hv_set_ifconfig.sh
! h$ I2 d9 h- C7 p$ V. vlinux-cloud-tools-common: /usr/sbin/hv_set_ifconfig
; ^' _. D8 @3 j! p: ^: B6 K' t; 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
1 P: p+ C  \  G# {. K2 e: olinux-gcp-headers-5.15.0-1003: /usr/src/linux-gcp-headers-5.15.0-1003/tools/hv/hv_set_ifconfig.sh" [( A& Y5 r6 D, x
linux-gcp-headers-5.15.0-1032: /usr/src/linux-gcp-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
. M2 b' i. p4 z4 w* |6 Xlinux-gke-headers-5.15.0-1002: /usr/src/linux-gke-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh: i( H6 F, E0 @% ^; C
linux-gke-headers-5.15.0-1032: /usr/src/linux-gke-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh
& w4 q8 P: |1 I7 c$ Mlinux-gkeop-headers-5.15.0-1019: /usr/src/linux-gkeop-headers-5.15.0-1019/tools/hv/hv_set_ifconfig.sh
- ~% B# @9 E! L' R8 q3 Xlinux-headers-5.15.0-25: /usr/src/linux-headers-5.15.0-25/tools/hv/hv_set_ifconfig.sh, ^. U) C/ u, D- p" H1 B) c( ^
linux-headers-5.15.0-71: /usr/src/linux-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh
( r& X- X5 n( A' nlinux-hwe-5.19-headers-5.19.0-41: /usr/src/linux-hwe-5.19-headers-5.19.0-41/tools/hv/hv_set_ifconfig.sh4 _6 J3 ?* I3 e6 _( q! n
linux-ibm-headers-5.15.0-1002: /usr/src/linux-ibm-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh
6 M9 {  A, E0 l( A# v# Blinux-ibm-headers-5.15.0-1029: /usr/src/linux-ibm-headers-5.15.0-1029/tools/hv/hv_set_ifconfig.sh
9 k1 H* P3 Q" y  tlinux-intel-iotg-cloud-tools-common: /usr/sbin/hv_set_ifconfig
$ N+ R8 W0 ?7 m) e0 _( Zlinux-intel-iotg-headers-5.15.0-1004: /usr/src/linux-intel-iotg-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
* q% x2 P7 Q% }linux-intel-iotg-headers-5.15.0-1028: /usr/src/linux-intel-iotg-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh7 C. C. q& n0 s, C0 u
linux-kvm-headers-5.15.0-1004: /usr/src/linux-kvm-headers-5.15.0-1004/tools/hv/hv_set_ifconfig.sh
2 E0 d3 e0 \/ }5 x$ K5 ?. Mlinux-kvm-headers-5.15.0-1032: /usr/src/linux-kvm-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh, ?* C) P  }  }& [
linux-lowlatency-headers-5.15.0-24: /usr/src/linux-lowlatency-headers-5.15.0-24/tools/hv/hv_set_ifconfig.sh0 O5 `8 R3 j$ i9 [. N2 [; X
linux-lowlatency-headers-5.15.0-71: /usr/src/linux-lowlatency-headers-5.15.0-71/tools/hv/hv_set_ifconfig.sh
) ]  K6 Q5 H3 S) P" z# ]) ^7 Tlinux-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.sh5 S, q5 o, m& c( A1 _% V/ r
linux-nvidia-5.19-cloud-tools-common: /usr/sbin/hv_set_ifconfig
( |) H& W$ y1 K7 ulinux-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  ^: h! \# _! o; R$ g0 `
linux-nvidia-cloud-tools-common: /usr/sbin/hv_set_ifconfig
9 e& @* X3 \8 xlinux-nvidia-headers-5.15.0-1023: /usr/src/linux-nvidia-headers-5.15.0-1023/tools/hv/hv_set_ifconfig.sh2 z+ P( i/ ~7 E4 T% W
linux-nvidia-tegra-headers-5.15.0-1012: /usr/src/linux-nvidia-tegra-headers-5.15.0-1012/tools/hv/hv_set_ifconfig.sh2 B: `7 B+ a1 }0 C
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.sh6 x6 D. T6 ], F5 v$ Z& G
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! Y  H# M! ^) ~& O2 L4 j
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$ B% t( p# z4 {6 [/ ]
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.sh6 v" f( S7 j9 z/ y' {
linux-oracle-headers-5.15.0-1002: /usr/src/linux-oracle-headers-5.15.0-1002/tools/hv/hv_set_ifconfig.sh7 a  \- O  j3 Q2 S* j
linux-oracle-headers-5.15.0-1034: /usr/src/linux-oracle-headers-5.15.0-1034/tools/hv/hv_set_ifconfig.sh8 }" v5 I6 u* p) h% |4 k% E3 z4 T3 `
linux-realtime-headers-5.15.0-1032: /usr/src/linux-realtime-headers-5.15.0-1032/tools/hv/hv_set_ifconfig.sh0 U. B1 q1 }( k
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.sh3 E7 O* k' p  Y) l! U, X
linux-riscv-headers-5.15.0-1007: /usr/src/linux-riscv-headers-5.15.0-1007/tools/hv/hv_set_ifconfig.sh% l* P( d3 J; o- w' L
linux-riscv-headers-5.15.0-1028: /usr/src/linux-riscv-headers-5.15.0-1028/tools/hv/hv_set_ifconfig.sh! @* d+ a* Q; [! {. [* d! S, a
linux-source-5.15.0: /usr/src/linux-source-5.15.0/debian/cloud-tools/hv_set_ifconfig( m% @; Q/ S1 l. D5 ?9 G9 m
linux-source-5.19.0: /usr/src/linux-source-5.19.0/debian/cloud-tools/hv_set_ifconfig
$ U- d: z7 d) _5 c* |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. O2 D, h+ x9 [( L' ]9 N% j  o
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
7 _+ `9 i, T6 umanpages-es: /usr/share/man/es/man8/ifconfig.8.gz
6 T7 V2 Y. M( ^8 B9 |9 Umanpages-ja: /usr/share/man/ja/man8/ifconfig.8.gz) _+ j. {' |& {6 i2 ?2 E0 ^
manpages-pl: /usr/share/man/pl/man8/ifconfig.8.gz( p5 b' U7 N" k, {3 ^
manpages-tr: /usr/share/man/tr/man8/ifconfig.8.gz
: _: S% n9 v. H' U$ Wmanpages-zh: /usr/share/man/zh_CN/man8/ifconfig.8.gz
) O4 ^3 R7 M+ qmanpages-zh: /usr/share/man/zh_TW/man8/ifconfig.8.gz
; M. a1 @! ~. \5 c/ L$ W, Qnet-tools: /sbin/ifconfig
8 A& u  x6 m# T( s' Hnet-tools: /usr/share/man/de/man8/ifconfig.8.gz+ T! K" s2 e( U& a' k  e' L4 w5 w
net-tools: /usr/share/man/fr/man8/ifconfig.8.gz
3 e+ d: p  m; cnet-tools: /usr/share/man/man8/ifconfig.8.gz
' m# M6 ~: {0 I/ s" Q  X* c4 X+ nnet-tools: /usr/share/man/pt_BR/man8/ifconfig.8.gz
8 l" G# H2 o0 e! Apython-psutil-doc: /usr/share/doc/python-psutil-doc/examples/ifconfig.py/ H3 A& ~+ l+ M. l7 V. \
python3-ethtool: /usr/sbin/pifconfig3, `2 J5 R/ r5 f
python3-ethtool: /usr/share/man/man8/pifconfig3.8.gz! i$ r2 f" l: G  q
python3-sphinx: /usr/lib/python3/dist-packages/sphinx/ext/ifconfig.py
7 }. F& i5 p  i6 k0 y" uruby-packetfu: /usr/share/doc/ruby-packetfu/examples/ifconfig.rb
' A0 N, Y4 j  L# _sphinx-doc: /usr/share/doc/sphinx-doc/html/_sources/usage/extensions/ifconfig.rst.txt8 M# b' y3 _% ]) |. s
sphinx-doc: /usr/share/doc/sphinx-doc/html/usage/extensions/ifconfig.html
3 i. f- O2 |2 v; U+ u* p( \% A# tthefuck: /usr/share/thefuck/thefuck/rules/ifconfig_device_not_found.py2 m, f, \9 O8 ~; S! n; U9 ^
weevely: /usr/share/weevely/modules/net/ifconfig.py) n/ F, p& P* @0 Q  z6 `
zsh-common: /usr/share/zsh/functions/Completion/Unix/_ifconfig0 [1 U9 I  I+ a: \, O
3 k. v2 e  W6 T

0 ^$ X' V4 f, q7 _& b" ]- U; t/ h
/ E% y. u0 x: R- |9 d, U* f
8 y0 e0 X( C, W0 X# I

1 h% j. j  b* I! s: U3 D& c& c
) t- ?7 H% _4 ^/ {- ?4 C, R) C
 楼主| 发表于 2023-5-12 22:58:30 | 显示全部楼层
apt install -y apt-file && apt-file update && apt-file search netstat |grep bin
9 Z5 C* K5 s8 h% z6 p
$ U) c( A% w& Q. T2 f5 K然后你会看到那么几行。从列出来的包名和后面的绝对路径可以判断出应该安装的是net-tools包,所以执行apt install -y net-tools
 楼主| 发表于 2023-5-12 23:26:32 | 显示全部楼层
root@localhost:~# apt-file search -x 'bin/ifconfig$'
, L9 S+ L8 ]. o4 f* a" K+ j$ Snet-tools: /sbin/ifconfig                 
- A9 k  M, _! Eroot@localhost:~# apt-file search -x 'bin/rz$'
" n9 i( G( `) I; `6 u( u4 \- ?lrzsz: /usr/bin/rz        
               
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

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

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

GMT+8, 2026-4-8 20:23 , Processed in 0.046384 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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