Comparing the apt-get and aptitude package tools
You will attract errors and add confusion if you alternately use apt-get and aptitude – for example, if you install Package A with aptitude, then use apt-get to remove Package A, and the install Package B, again with aptitude.
In the first step, aptitude sets up any actions and installs Package A. In the second step, apt-get deletes Package A without aptitude knowing anything about it, so aptitude assumes the package is still installed. In the last step, aptitude installs package B along with package A, again because package A is in the list of packages to be installed by aptitude. Package B is considered "lost" by aptitude and therefore needs to be set up again for installation.
Conversely, the same would not occur. Aptitude doesn't remove a package installed by apt-get behind its back because the software considers it "installed" in its list. This behavior belongs to the group of bugs centered around holds between aptitude and dpkg/dselect . To avoid the trouble, it's best to decide on one of the package managers and stay with it.
This detail especially gains in importance when software in an APT repository indicates that it should be installed via aptitude install package_name . This call might potentially install the package, but it can also drag along all of aptitude's scheduled package actions – which is not always the developer's intention. The same danger might not exist with apt-get install package_name .
Apt-get and aptitude are command-line package managers for Debian-based systems, including Ubuntu and its many variants. If you are growing weary of the Software Center and prefer to work from the command line, either apt-get or aptitude will do the job – but don't try to use them both. Whether you adopt apt-get or aptitude is entirely your decision and has nothing to do with the software you wish to install.
Apt-get and Aptitude Subcommands
|Update package lists||update||update|
|Conservatively update packages||upgrade||safe-upgrade|
|Update all packages||dist-upgrade||full-upgrade|
|Install package||install package_name||install package_name|
|Re-install package||install --reinstall package_name||reinstall package_name|
|Remove package||remove package_name||remove package_name|
|Remove package plus configuration files||purge package_name||purge package_name|
|Remove unused package||autoremove||-|
|Hold package||Not available (1)||hold package_name|
|Empty package cache (completely)||clean||clean|
|Delete all available sources||autoclean||autoclean|
|Show package information||show (2)||show package_name|
|Show why package installed||-||why package_name|
|Show why package not installed||-||why-not package_name|
|Show dependency errors||check||search '~b'|
|Search for package||search (2)||search pattern|
|Show available package versions||policy (2)||versions package_name|
|(1) via dpkg-hold package_name . (2) via apt-cache (also in package apt).|
- Cupt: https://wiki.debian.org/Cupt
- Posting from D. Kalnischkies: http://lists.alioth.debian.org/pipermail/aptitude-devel/2012-January/001823.html
- Debtree: http://collab-maint.alioth.debian.org/debtree/
- GraphViz: http://www.graphviz.org
- Aptitude package dependency graphs: http://collab-maint.alioth.debian.org/debtree/aptitude1.html
- Blog posting "aptitude-gtk will likely vanish": http://noone.org/blog/English/Computer/Debian/aptitude-gtk%20will%20likely%20vanish.html
- Aptitude manual: http://people.debian.org/~abe/aptitude/en
- Aptitude status syncing bug: http://bugs.debian.org/137771