tool:apt-cache 

Basic Info 

Usage 

apt-cache search 

Search the package list for a regex pattern

$ apt-cache search pango
pango - System for layout and rendering of internationalized text.
pango-devel - System for layout and rendering of internationalized text.
pygtk2 - Python bindings for the GTK+ widget set.
apt-cache show 

Show a readable record for the package

$ apt-cache show pan
Package: pan
Section: Applications/Internet
Installed Size: 2794
Maintainer: Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Version: 1:0.14.0-2
Pre-Depends: rpmlib(CompressedFileNames) (<= 3.0.4-1), rpmlib(PayloadFilesHavePrefix) (<= 4.0-1)
Depends: glib2, gtk2, libatk-1.0.so.0, libc.so.6, libc.so.6(GLIBC_2.0), libc.so.6(GLIBC_2.1), libc.so.6(GLIBC_2.1.2), libc.so.6(GLIBC_2.2), libc.so.6(GLIBC_2.3), libdl.so.2, libgdk-x11-2.0.so.0, libgdk_pixbuf-2.0.so.0, libglib-2.0.so.0, libgmodule-2.0.so.0, libgobject-2.0.so.0, libgthread-2.0.so.0, libgtk-x11-2.0.so.0, libm.so.6, libpango-1.0.so.0, libpangox-1.0.so.0, libpangoxft-1.0.so.0, libpthread.so.0, libpthread.so.0(GLIBC_2.0), libpthread.so.0(GLIBC_2.1), libxml2.so.2, libz.so.1
Provides: pan (= 1:0.13.0-2)
[...]
apt-cache whatdepends 

Show raw dependency information on a package

$ apt-cache whatdepends pango
pango-1.1.1-1
  pango-devel-1.1.1-1
    Depends: pango = 1.1.1
  libgnomeui-2.0.3-3
    Depends: pango >= 1.0.99
    Depends: <libpango-1.0.so.0>
      pango-1.1.1-1
    Depends: <libpangoft2-1.0.so.0>
      pango-1.1.1-1
    Depends: <libpangox-1.0.so.0>
      pango-1.1.1-1
    Depends: <libpangoxft-1.0.so.0>
      pango-1.1.1-1
  gtk2-2.0.6-8
    PreDepends: pango >= 1.0.99.020703-1
    Depends: <libpango-1.0.so.0>
      pango-1.1.1-1
    Depends: <libpangox-1.0.so.0>
      pango-1.1.1-1
    Depends: <libpangoxft-1.0.so.0>
      pango-1.1.1-1
  pan-1:0.14.0-2
    Depends: <libpangoxft-1.0.so.0>
[...]
apt-cache policy 

Q: How can I tell which packge comes from which repository? A: Use apt-cache policy.

$ apt-cache policy xmms
xmms:
  Installed: 1:1.2.10-2.0.1.kde
  Candidate: 1:1.2.10-2.0.1.kde
  Version Table:
 *** 1:1.2.10-2.0.1.kde 0
        996 http://kde-redhat.atrpms.net 1/stable pkglist
        996 ftp://apt.kde-redhat.org 1/stable pkglist
        100 RPM Database
     1:1.2.10-1.p 0
        996 http://ayo.freshrpms.net fedora/linux/1/i386/updates pkglist
        996 http://ftp.ussg.iu.edu fedora/1/i386/updates pkglist
     1:1.2.8-3.p 0
        996 http://ayo.freshrpms.net fedora/linux/1/i386/core pkglist
        996 http://ftp.ussg.iu.edu fedora/1/i386/os pkglist

Info 

apt-cache is a low-level tool used to manipulate APT's binary cache files, and query information from them

Help 

Quick Help 

Usage:

apt-cache [options] command
apt-cache [options] add file1 [file2 ...]
apt-cache [options] showpkg pkg1 [pkg2 ...]
apt-cache [options] showsrc pkg1 [pkg2 ...]

Commands:

add - Add a package file to the source cache
gencaches - Build both the package and source cache
showpkg - Show some general information for a single package
showsrc - Show source records
stats - Show some basic statistics
dump - Show the entire file in a terse form
dumpavail - Print an available file to stdout
unmet - Show unmet dependencies
search - Search the package list for a regex pattern
show - Show a readable record for the package
depends - Show raw dependency information for a package
whatdepends - Show raw dependency information on a package
pkgnames - List the names of all packages
dotty - Generate package graphs for GraphVis
policy - Show policy settings

Detail Help 

See the apt-cache(8) and apt.conf(5) manual pages for more information.

dotty 

dotty takes a list of packages on the command line and gernerates output suitable for use by dotty from the GraphViz < package. The result will be a set of nodes and edges representing the relationships between the packages. By default the given packages will trace out all dependent packages which can produce a very large graph. This can be turned off by setting the APT::Cache::GivenOnly option.

The resulting nodes will have several shapse:

normal packages are boxes, pure provides are triangles, mixed provides are diamonds, hexagons are missing packages. Orange boxes mean recursion was stopped [leaf packages],

blue lines are pre-depends, green lines are conflicts.

Caution, dotty cannot graph larger sets of packages.

Test Run 

apt-cache dotty gedit > /tmp/gedit.dot
dotty /tmp/gedit.dot &
apt-cache -o=APT::Cache::GivenOnly=1 dotty gedit > /tmp/gedit.dot
!dotty
apt-cache -o=APT::Cache::GivenOnly=1 dotty eog gedit gftp gqview hwbrowser magicdev control-center desktop-file-utils gnome-applets gnome-panel gnome-session gnome-spell gnome-terminal gnome-utils metacity nautilus switchdesk-gnome > /tmp/gnome.dot
dotty /tmp/gnome.dot &