apt-get provides a simple way to install packages from the command
line. Unlike dpkg, apt-get does not understand .deb files,
it works with the packages proper name and can only install .deb archives from
a Source.
The first [1] thing that
should be done before using apt-get is to fetch the package lists
from the Sources so that it knows what packages are
available. This is done with apt-get update. For instance,
# apt-get update Get http://ftp.de.debian.org/debian-non-US/ stable/binary-i386/ Packages Get http://llug.sep.bnl.gov/debian/ frozen/contrib Packages Reading Package Lists... Done Building Dependency Tree... Done
Once updated there are several useful commands that can be used,
Dselect or apt-get install can be used to force these
packages to install.
As an added complication there is the possibility for a package to pretend to be another package. Consider that exim and sendmail for many intents are identical, they both deliver mail and understand a common interface. Hence, the package system has a way for them to declare that they are both mail-transport-agents. So, exim and sendmail both declare that they provide a mail-transport-agent and other packages that need a mail transport agent depend on mail-transport-agent. This can add a great deal of confusion when trying to manually fix packages.
At any given time a single dependency may be met by packages that are already installed or it may not be. APT attempts to help resolve dependency issues by providing a number of automatic algorithms that help in selecting packages for installation.