Apt, Aptitude and Dpkg are Debian package managing tools. Let's see a small reference about them:
#apt-get install foo .......................Installs foo package
#apt-get remove foo ........................Removes foo package
#apt-get remove --purge foo ................Removes foo package and its configuration files.
#apt-get update ............................Updates package database.
#apt-get -f install.........................Installs and removes packages in order to fix dependency problems.
#apt-get clean .............................Deletes all .deb packages from local repository.
#apt-get upgrade ...........................Upgrades all packages to its newer versions.
#apt-get dist-upgrade ......................Upgrades packages but also deals with dependency problems caused by new packages.
$apt-get source foo ........................Downloads foo package source files.
$apt-cache show foo ........................Gives a long info description about foo package.
$apt-cache search foo ......................Searchs for packages that match "foo" pattern.
#apt-file update ...........................Resynchronize the package contents from their sources (/etc/apt/sources.list)
$apt-file search foo .......................Lists all packages containing files that match foo pattern. Searchs also in not installed packages.
#aptitude install foo ......................Installs foo package
#aptitude remove foo .......................Removes foo package
#aptitude remove --purge foo ...............Removes foo package and its configuration files.
$aptitude search foo .......................Searchs for packages that match "foo" pattern
#aptitude update ...........................Updates package database.
#aptitude upgrade ..........................Upgrades packages to its newer versions.
#aptitude safe-upgrade .....................Same as aptitude upgrade.
#aptitude full-upgrade .....................Upgrades packages to its newer versions, taking care about dependencies. Sames as dist-upgrade.
#aptitude hold foo .........................Marks foo package so it will not be removed or upgraded when executing safe-upgrade or full-upgrade
#aptitude unhold foo .......................Turn off the hold on foo package.
$aptitude show foo .........................Gives a long info description about foo package.
#aptitude clean ............................Removes all previously downloaded .deb files from the package cache directory.
#dpkg -i foo ...............................Installs foo package
#dpkg -i --force-depends foo ...............Converts all dependency errors into warnings and installs foo package.
#dpkg -r foo ...............................Removes foo package
#dpkg --purge foo ..........................Removes foo package and its configuration files too.
$dpkg -l *foo* .............................Lists packages containing "foo" pattern.
$dpkg -L foo ...............................Lists files pertaining to foo package.
#dpkg-reconfigure -plow foo ................Reconfigures previously installed "foo" package, asking all configuration questions.
#dpkg --configure -a ...........................Configures all packages that have been unpacked but not yet configured.
$dpkg --search foo .........................Lists packages containing files matching foo pattern. Only searchs on installed packages.