Ubuntu apt-cache命令查找可用软件包

本文GoFace给大家讲解下在Ubuntu及相同包管理的linux系统下如何查找可用软件包。在Ubuntu上大家一般使用apt-get安装软件,如果想查找某一包软件仓库中是否有,并不是使用apt-get search或apt-get –list,而使用apt-cache命令。

apt-cache search string  //在源软件列表中查找相应的软件包

下面我以fping这个软件包为例,fping可以使用 round-robin方式ping,非常强大,GoFace会在下一篇博客中介绍.fping默认系统并不自带。

#apt-cache search fping

fping - sends ICMP ECHO_REQUEST packets to network hosts

oping - sends ICMP_ECHO requests to network hosts

#apt-cache search fping

Package: fping

Priority: optional

…….

Description: sends ICMP ECHO_REQUEST packets to network hosts

fping is a ping like program which uses the Internet Control Message Protocol

(ICMP) echo request to determine if a target host is responding.  fping

differs from ping in that you can specify any number of targets on the command

line, or specify a file containing the lists of targets to ping.  Instead of

sending to one target until it times out or replies, fping will send out a

ping packet and move on to the next target in a round-robin fashion.

Homepage: http://fping.sourceforge.net/

#apt-cache depends fping   //查找fping依赖哪些包

Depends: libc6

Conflicts: <suidmanager>

Replaces: <netstd>

#apt-get rdepends fping   //查找哪些包依赖fping

Reverse Depends:

mplayer

dvdrip

zabbix-server-pgsql

zabbix-server-mysql

zabbix-proxy-pgsql

zabbix-proxy-mysql

whereami

……

只有depends才能确定真正的依赖性,反向的依赖性不一定可靠。Depends开头的是必须安装的,Recommends不是必需的。如fping并不是mplayer是必需的。

#apt-cache depends mplayer

其中Suggests:fping 说明fping对mplayer并是必需的。

#apt-cache depends  zabbix-server-mysql

结果显示fping是Depends,说明fping对 zabbix-server-mysql是必需的。

另外apt-get install package时Depends或是Recommends开头的行中的包都将被安装,而以Suggests开头的行中的包不会被安装。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值