Long time ago I discuss with a friend which are the differences between aptitude and apt, well this entry is just a summary of the most useful information what I found about this matter.
First of all see which are their descriptions:
APT Description: Advanced front-end for dpkg
This is Debian’s next generation front-end for the dpkg package manager.
It provides the apt-get utility and APT dselect method that provides a simpler, safer way to install and upgrade packages.
APT features complete installation ordering, multiple source capability and several other unique features, see the Users Guide in apt-doc.
APTITUDE Description: terminal-based package manager
aptitude is a package manager with a number of useful features, including: a mutt-like syntax for matching packages in a flexible manner, dselect-like persistence of user actions, the ability to retrieve and display the Debian changelog of most packages, and a command-line mode similar to that of apt-get.
aptitude is also Y2K-compliant, non-fattening, naturally cleansing, and housebroken.
Minor differences could be found here and here:
- aptitude provides a terminal menu interface
- aptitude will automatically remove eligible packages, whereas apt-get requires a separate command to do so
- aptitude has a slightly different query syntax for searching (compared to apt-cache)
- aptitude has the why and why-not commands to tell you which manually installed packages are preventing an action that you might want to take
- If the actions (installing, removing, updating packages) that you want to take cause conflicts, aptitude can suggest several potential resolutions. apt-get will just say “I’m sorry Dave, I can’t allow you to do that.”
- aptitude adds explicit per-package flags, indicating whether a package was automatically installed to satisfy a dependency: you can manipulate those flags (aptitude markauto or aptitude unmarkauto) to change the way aptitude treats the package.
- apt-get keeps track of the same information, but will not show it explicitly. apt-mark can be used for manipulating the flags.
- aptitude will offer to remove unused packages each time you remove an installed package, whereas apt-get will only do that if explicitly asked to with apt-get autoremove or specify –auto-remove
- In contrast to apt-cache’s “search”, aptitude’s “search” output also shows the installed / removed / purged status of a package (plus aptitude’s own status flags)
Let’s get the time took for these tools doing the same operations (obviously execution time depends on the state of my system although can be useful information):
Updating package information (notice I first run ‘apt-get update’ so ‘aptitude update’ less information was downloaded but two commands report the same time in downloading stage):
# time apt-get update ... Fetched 366 kB in 41s (8,786 B/s) Reading package lists... Done real 0m47.396s user 0m12.781s sys 0m1.204s # time aptitude update ... Fetched 137 kB in 41s (3,284 B/s) real 0m54.102s user 0m16.157s sys 0m1.472s
Searching a package (time searching is considerably higher using aptitude than apt-cache, but the results seem more accurate according then word searched in aptitude):
# time apt-cache search squashfs disktype - detection of content format of a disk or disk image p7zip-full - 7z and 7za file archivers with high compression ratio squashfs-tools - Tool to create and append to squashfs filesystems squashfs-tools-dbg - Tool to create and append to squashfs filesystems (debug) real 0m0.695s user 0m0.616s sys 0m0.068s # time aptitude search squashfs p squashfs-tools – Tool to create and append to squashfs filesystems p squashfs-tools:i386 – Tool to create and append to squashfs filesystems p squashfs-tools-dbg – Tool to create and append to squashfs filesystems (debug) p squashfs-tools-dbg:i386 – Tool to create and append to squashfs filesystems (debug) real 0m5.342s user 0m5.076s sys 0m0.252s
Obviously you can do the same things with both of them so I hope this information help you to choose the command you like the most 😉
“Simplicity, patience, compassion. These three are your greatest treasures. Simple in actions and thoughts, you return to the source of being. Patient with both friends and enemies, you accord with the way things are. Compassionate toward yourself, you reconcile all beings in the world.”
Lao Tzu, Tao Te Ching