As various associates and friends of mine know, my typical Linux distribution of choice is Debian. Once upon a time, the main thing that differentiated Debian from other distributions was a nifty suite of tools called APT, or Advanced Packaging Tool. While users of "those other distributions" wallowed in RPM hell, having to track down package dependencies manually, Debian users relied on a vast online archive of packages all parsed by the apt system. By using the apt-get tool Debian users could install one package, and all required dependencies would be installed and configured automagically. No scouring the 'Net for a specific version of an RPM. Coolness!
Of course, most distributions noticed that this was a really cool idea, and have since either cloned or ported it. It's a sorry distribution these days that doesn't have some sort of automagic package dependency tracking (whether binary or source based like Gentoo), and if you throw a CD you're likely to hit a distribution that uses apt of some kind. That's the power of open source development at its best; sharing ideas and letting the good ones win.
(To be accurate, it should be pointed out that Apt is not comparable to RPM. Dpkg is the Debian equivalent to RPM, as it is the package manager and format itself. Apt, Yum, and other dependency managers are a level above the package manager, just as the package manager is a level above the tar.gz file. So please, no Apt vs. RPM flamewars, as that's apples to oranges. Thanks. :-) )
Of course, Debian didn't sit still. Apt is a great system, but the interface(s) to it, well... On the command line, you have a suite of tools, some of which are part of the base Apt system and some of which aren't:
- apt-get: Installs and removes packages, and updates the local cache of what packages are available.
- apt-cache: Maintain and search the local cache of what packages are available.
- apt-listbugs: List what bugs (if any) are registered against a given package before you install it (very useful for people like me who run the Sid/Unstable version).
- apt-listchanges: Same thing, but for non-bug changes.
- apt-rdepends: Tool for viewing dependency trees.
- deborphan: Try and figure out what packages are installed that you don't really need.
- debfoster: Helps deborphan figure out what packages you don't need anymore, but only if you knew to install it before you installed the package.
- dpkg: The RPM-equivalent for Debian, you have to use dpkg half the time to do various maintenance tasks.
Why all of the differently named programs? And why is updating the local cache part of apt-get instead of apt-cache? That's to say nothing of the usability problems that the name "apt-get" creates. I can't count the number of times people new to Debian (myself included) tried to run
apt-get pkgname instead of
apt-get install pkgname. I'm already getting, why do I need to say it twice? And then there's always the method of uninstalling a package:
apt-get remove pkgname, or if you want to remove the configuration files as well it's
apt-get --purge remove. "Get Remove"? "Get Purge Remove", not "Get Remove Purge"? That's right up there with the immortal question, "Why do I have to Start in order to Shutdown?"
Moreover, apt-get is a one-way tracker. Install package A, which requires package B. Then remove package A. Package B is still sitting there on your system taking up space, and hopefully nothing else.
deborphan can help, but it isn't perfect. Then there's
apt-cache search, which does simple text searching on every package's description and returns an unordered list of packages, generally containing far more than reasonably match.
And then there's the console-GUI,
dselect. The less said about dselect the better. It is an excellent example of how not to build a console-GUI application, and I would recommend it for required study in HCI classes if it weren't likely to result in severe mental trauma. Let us not mention it again.
So with all of these problems with the Apt system, what did the Debian folks do? They demonstrated their
aptitude for problem solving.
Aptitude is the "next generation apt" program. You want to use it. Full stop. Why? Well, there are a couple of reasons.
First of all, it greatly simplifies the interface. apt-get and apt-cache functionality has now been integrated into a single application (as well as various of the other utilities) without the "Start Shutdown" type confusion:
aptitude update: Update the local cache of available packages (formerly apt-get update.
aptitude upgrade: Upgrade available packages (formerly apt-get upgrade).
aptitude dist-upgrade: Upgrade available packages even if it means removing stuff (formerly apt-get dist-upgrade).
aptitude install pkgname: Install package (formerly apt-get install).
aptitude remove pkgname: Uninstall package (formerly apt-get remove).
aptitude purge pkgname: Uninstall package and config files (formerly apt-get --purge remove).
aptitude search string: Search for a package with "string" in the name or description (formerly apt-cache search string).
aptitude show pkgname: Show detailed of a package (formerly apt-cache show pkgname).
aptitude clean: Delete downloaded package files (formerly apt-get clean).
aptitude autoclean: Delete only out-of-date package files but keep current ones (formerly apt-get autoclean).
aptitude hold pkgname: Fix a package at its current version and don't upgrade it automatically (formerly an obscure echo-to-file command). unhold to remove the hold.
And so on. Seems nicer already, doens't it? It gets better. Aptitude's search results are by default sorted alphabetically, and shown in a justified column format instead of haphazardly like apt-cache output. It even flags which of them are already installed, which are installable, which are virtual packages, which are on hold, etc. That makes finding a package much easier. When installing a package, aptitude will by default show you what other packages are recommended or suggested but not, strictly speaking, required. That gives you the chance to install those, too, if you think they make sense.
More importantly, aptitude supports two-way dependency tracking. That is, if you install package A which requires package B, then remove package A, aptitude will check to see if anything else you've installed recently requires B. If not, it will let you know that B is now a waste of disk space and will be removed; no need to play with deborphan or debfoster. It only works if you used aptitude to install the packages in the first place, but if you just stick to aptitude then it's much easier than remembering to install debfoster on every system.
And what about a console-GUI to replace the evil-program-that-shall-not-be-named? Aptitude is its own console-GUI. Simply run
aptitude with no parameters and up pops a console-GUI version for your downloading pleasure. It's still not as clean as a true GUI application (few complex console-GUIs are), but it's light-years ahead of you-know-what. It has a better online help system, a more standard menu, and an integrated copy of Minesweeper. Coolness!
The only downside to aptitude is that, unlike apt-get, it does not have Super Cow Powers. While disappointing, it's an acceptable trade off for a much more functional, flexible, and usable dependency management system.
So if you're using Debian, put down the apt-get and give aptitude a try. If you're using some other apt-based or apt-using distribution, see if it has aptitude. If it doesn't, switch to a distribution that does. And while you're at it, give a big round of applause to Daniel Burrows, the man behind aptitude. Thanks, Daniel!