bapoumba's blog

Aptitude [en]

aptitude is another package manager based on apt, as apt-get, apt-cache, synaptic and adept. One great advantage is the way aptitude handles dependencies (depend, recommend, conflict packages).aptitude lists auto-installed packages in /var/lib/aptitude/pkgstates, automatically removes unused auto-installed packages (when they are not a dependency of any other package for example) and logs history in /var/log/aptitude.

Synaptic only logs history (> File > History) and apt-get does not log at all and relies on dpkg‘s.

Edit: apt-get has now an autoremove option.

This is why it is not recommended to alternatively use aptitude and apt-get, aptitude‘s log will not be complete and problems may be encountered when removing packages (many packages to remove for example). If aptitude suggests removing packages when you know they are needed, you should reinstall them with aptitude so that they make it to the log file.

Do not believe that using aptitude will allow you to mix Ubuntu repositories with non-Ubuntu ones in your sources.list ;-)

aptitude interface in a terminal

Run aptitude in a terminal, you’ll get to a two parts ncurses interface :

Clic on the top menu (or CTRL-t) to see the different possibilities and keyboard shortcuts. CTRL-t will get you back to the main screen. The bottom of the screen shows a short description of the menu. If you enter ?, you will get to a help screen.

aptitude will warn you for broken dependencies, will tell you why and suggest solutions.

When update-manager pops you up for an upgrade, you can run it from CLI (see below) or from a terminal. If you did not start aptitude in root mode, you can do it now from the action menu.
Hit “u” to mark upgradable packages, and “U” to run the upgrade :

aptitude in CLI

Main options are : install, remove, purge, show, search, update, upgrade, dist-upgrade. See man aptitude.
If conflitcs are present when installing or removing packages, aptitude will warn you make some suggestions.

Tips and tricks

You did not start aptitude in sudo mode and you need to be root to do something ? When needed, aptitude will offer to gain root priviledges and will prompt you for your password (no more need to launch synaptic in root mode to look for informations on a package ^^)

The configuration file is ~/.aptitude/

You do not like the default color theme ? You can change it all in the configuration file

You can run a simulation with -s

Search and show options for packages informations

When an upgrade is difficult, aptitude will perform the least harmful action first. If it fails, or is not enough, running a second upgrade will end up with more aggressive actions (CTRL + U to cancel).