Linux – Aptitude vs. apt-get: Which is the recommended (aka the “right”) tool to use

aptaptitudedebianlinuxUbuntu

Some time ago I read that aptitude is the preferred tool for installation on Debian-based systems. But when you search around on how to administer a Debian-based system, then aptitude is rarely mentioned. Most people seem to prefer apt-get – and that's even true for the Debian wiki pages!

Thus I am wondering if I have missed something. Which is the right tool to use?

Best Answer

aptitude and apt-get work the same for many tasks, but for the most tricky cases, such as distribution upgrades (apt-get dist-upgrade vs. aptitude full-upgrade), they have different rules, and aptitude's rules are nearly always better in practice where they disagree.

The reason you see more documentation for apt-get over aptitude is mostly inertia: aptitude has not been the recommended front end to APT for all that long, so much of the existing documentation hasn't been updated, and there are plenty of people who recognise the advantages of aptitude over apt-get but use apt-get reflexively.

I've recently got to the point where I usually follow apt with a iand not a - when I type.

Postscript Note that the rules used in apt-get and aptitude are moving targets - as Hubert notes in comments, the upgrade path recommended from Debian Lenny now uses apt-get, not aptitude. This reflects the fact that apt-get keeps track of less state about the current package than aptitude, and so does not need to worry about APT state not being "clean", and because apt-get rules are smarter than they used to be. I still use and recommend aptitude over apt-get, but it is a more nuanced recommendation

Related Question