If you think smart is intelligent or if you think yum is tasty, aptitude will expand your thoughts with attitude.
Last week, in Part One of this Debian Package Primer, I gave you an introduction to the super cow powers of apt-get, Debian’s package management system. This week, in Part Two, you’ll check out aptitude, which is an easy to use front-end for apt-get. It has menus, shortcuts and a package status dashboard that keeps you aware of your installed packages and how many you have yet to install.
If you’re like me, an avid apt-get user, then you’ve felt the frustration of typing in what you think is the correct package name and seeing the incredibly informative and helpful, “Couldn’t find package X” message. Aptitude gives you menu-driven super cow powers and removes much of that frustration.
The Basics
Unlike apt-get, you don’t have to be root to start aptitude, or look around, but you do have to have root privileges to install, update or remove packages. To start using aptitude, type aptitude at a prompt.
$ aptitude
Or, if you prefer to have root privileges,
$ sudo aptitude
A menu similar to the one in Figure 1 will appear.

Highlighted by default are your Installed Packages or Security Updates (depending on when you performed your last update0 and their number. Press the ENTER key to explore packages listed under any of the major headings. You’ll see that these are cascading menus, meaning that they are hierarchical, with submenus. Once you’ve opened the admin menu, for example, you’ll see main – The main Debian archive (33). Opening that menu reveals a list of installed packages as shown below.
--\ Installed Packages (281)
--\ admin - Administrative utilities (install software, manage user, etc) (33)
--\ main - The main Debian archive (33)
i acpi-support-base 0.109-11 0.109-11
i adduser 3.110 3.110
i aptitude 0.4.11.11- 0.4.11.11-
You can see that this menu-driven system is much easier than searching for a package name (or guessing at it) and then using dpkg to display information about it.
# dpkg -l |grep apt
ii apt 0.7.20.2 Advanced front-end for dpkg
ii apt-utils 0.7.20.2 APT utility programs
ii aptitude 0.4.11.11-1~lenny1 terminal-based package manager
ii laptop-detect 0.13.6 attempt to detect a laptop
ii libpcap0.8 0.9.8-5 system interface for user-level packet capture
# dpkg -l aptitude
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-====================-====================-===============================
ii aptitude 0.4.11.11-1~lenny1 terminal-based package manager
Let’s take a look now at what aptitude can do for you as a user or system administrator.
Using Aptitude
The aptitude menu system has keyboard shortcuts available, as well as, dropdown options for most activities. The dropdown options simplify your necessary operations until you’re more familiar with the corresponding shortcuts. For example, if there’s a keyboard shortcut available for the command or operation you want to perform, it’s shown on the menu.
The first thing I do when I enter aptitude is press the “u” key to update my package list. Doing so has the equivalent effect of the apt-get update command but with very different visual results (See Figure 2). Press the “u” key on your keyboard and watch your screen change.

The update process might take several minutes depending largely on how often you perform an update on your system.
The next step is to upgrade your system with all of the new found updates. To upgrade your upgradeable packages, press the “U” key. This marks all upgradeable packages. Press the “g” key to queue the upgradeable packages. Press “g” a second time to start the upgrade process.
If you aren’t root already, you’ll be prompted to become root before proceeding. You’ll have to press “g” one final time to start the process in this case. Once the process completes and returns you to the main menu, you’ll notice a difference in the number of installed packages. Mine went from 281 to 342.
Installing a single package is a simple process that requires no guessing, wildcard searches or Internet searching. Under “Uninstalled Packages,” find the package you want to install and press the “+” (plus) key to mark it. The package you selected turns green to show that you’ve selected it for installation. Information about the marked package appears in the window below the selected package.
Press the “g” key to queue the package and its dependencies. Press “g” again to launch the installation process.
To remove a package and its unused dependencies, you perform a similar set of operations to those of installation. Under “Installed Packages,” locate the package you want to remove and press the “-” (minus) key. The package will turn magenta in color and warn you of any packages that depend on the one you want to remove. When you’re satisfied with the package removal, press “g” to queue the removal and to list any unused dependencies. Press “g” again to remove the queued package(s).
From the Menu
The top menu options (Actions, Undo, Package, Resolver, Search, Options, Views, Help) in aptitude contain several options for you but there’s no on screen message or legend that tells you how to access it. To access the top menu, press the “F10″ key.
The Actions menu opens for you. Use your keyboard arrow keys to navigate to the various options and the other menu headings. Press the “ESC” key to toggle out of the top menu and back to the package dashboard.
This brief aptitude introduction will have you more productive and less frustrated with upgrading, installing and removing software packages. And, fumbling with packages and obscure package names can prove quite frustrating.
Next week, you’ll explore the wonderful world of Linux user and group administration.
Kenneth Hess is a Linux evangelist and freelance technical writer on a variety of open source topics including Linux, SQL, databases, and web services. Ken can be reached via his website at
http://www.kenhess.com. Practical Virtualization Solutions by Kenneth Hess and Amy Newman is available now.
Comments on "Do You Have an Aptitude for Software?"
How can a serious distro even have the package apt-get with \”This APT has Super Cow Powers\” and juvenile humour \”apt-get moo\”?
And how old is aptitude, must be at least 10 years? How can you promote such an old-fashioned ascii art command line tool, that reminds us oldies of cga monitors?
Aren\’t both just front ends to dpkg?
What about synaptic if you are using gnome, or webmin if remote managing?
Well, it makes me sick when I mistype a command such as \”sudo aptitude instal blender\” (note the missing \”l\”) and get the ridiculous message:
\”This aptitude does not have Super Cow Powers\”.
Is it serious software? Dude, get real!
Use the regular expression capability of dpkg. In the example, do
dpkg -l apt\\*rather thandpkg -l | grep apt.I, for one, has Synaptic installed, but somehow still prefer aptitude. It still seems to handle package dependencies better IMHO. OTOH I like the power of the command line and can get many things done quicker from the CLI than clicking around on the desktop. My other favourite program is mc (Midnight Commander), so maybe it is just personal taste?
Not sure what eshneto means when he says \’serious software\’, because the error message actually said something informative (in a cute way). Does he mean real serious software like MS Windows with which has so many illuminating error messages with it\’s blue screen of death?
Yum gets what I need to do done. Aptitude is just another crappy debian-ish package manager.
flomanno is right that the error message said something informative, but in this case there\’s a huge gap between informative and helpful. The information the message conveys to most users is \”we\’re in on the joke and you\’re not\”, and not much more than that! Hardly helpful in pointing out what\’s wrong in the command line options. I think such inside jokes, and the defense of them by Linux users who are used to them, is at least part of the reason that Linux retains its reputation as a system by and for geeks. There\’s nothing wrong with cute jokes as long as they don\’t come at the expense of helpful or useful information. If they do, then it really is high time to get serious.
No sense of humor… so sad. – Aptitude is very useful. If it doesn\’t suit your environment, then don\’t use it. And don\’t waste your precious time complaining.
+1 flo
In a better world -
Mistype a command such as \”sudo aptitude instal blender\” (note the missing \”l\”) and get the message:
\”This aptitude does not have Super Cow Powers\”.
- would be -
\”ERROR – Aptitude\’s thinks you meant \”sudo aptitude install blender\”
[YES] [NO] …then run the corrected command.
But that would require aptitude to be updated and maintained for of all commands and their common typos.
Remarkable issues here. I’m very happy to look your article. Thanks a lot and I’m taking a look ahead to touch you. Will you please drop me a e-mail?