在Ubuntu上大家一般使用apt-get安装软件,如果想查找某一包软件仓库中是否有,并不是使用apt-get search或apt-get –list,而使用apt-cache命令。
apt-cache search string //在源软件列表中查找相应的软件包
apt-cache depends string //查找相应的软件包依赖哪些包
apt-get rdepends string //查找哪些包依赖相应的软件包
#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是必需的。
转自 http://blog.51osos.com/linux/ubuntu-apt-cache-search-package/