Linoob’s Guide to ‘Aptitude’ in Ubuntu

Aptitude is a front-end to the Advanced Packaging Tool (APT) system. It displays a list of software packages and allows the user to interactively pick packages to install or remove. It has an especially powerful search system utilizing flexible search patterns. Aptitude also emulates most apt-get command line options. Newer versions also come with a GTK+ interface.

First, we will take up some basic operations of aptitude in terminal also called as Bash (Bourne Again SHell).The ‘dpkg’ and ‘apt’ tools have been around for a long time and work well, but there are many problems with both the tools. The aptitude tool tries to make things easier by automating some of the important package operations (like running apt-get update before upgrading or installing) while allowing enough flexibility to be useful. For these reasons, we recommend the use of aptitude at the command line whenever possible. So, lets begin :

First Things First

First, we need install aptitude if not installed & we do this simple by –

sudo apt-get install aptitude

Now, we can continue to our guide.

aptitude basics

  • sudo aptitude –  Starts the curses interface. Use Ctrl+t to access the menu and the q key to quit.
  • aptitude help –  Lists help for aptitude usage.
  • aptitude search <keyword> –  Lists packages matching the given keyword.

package management

  • sudo aptitude install <package> –  Installs the given package to the system.
  • sudo aptitude remove <package>  –  Removes the given package from the system.
  • sudo aptitude purge <package> – Used to purge an installed package from the system.
  • sudo aptitude download <package> –  Downloads the given package, but does not install it.
  • aptitude show <package> –  Lists information about the given package, installed or not.

updates &  upgrades

  • sudo aptitude update –   Updates the available package indexes from the APT sources.
  • sudo aptitude upgrade –  Upgrades all packages in use to their latest versions.
  • sudo aptitude safe-upgrade –  Upgrades the packges safely.
  • sudo aptitude dist-upgrade –  Upgrades all packages to their most recent versions, removing or installing packages as necessary. The upgrade option is advised over dist-upgrade.

package clean-up

  • sudo aptitude clean –  Removes all downloaded .deb files from the /var/cache/apt/archives directory.
  • sudo aptitude autoclean –  Removes all outdated .deb files from the /var/cache/apt/archives directory. This maintains a current cache without filling up the disk.

output simulation

  • sudo aptitude -s install <package> –  This is a really interesting feature of aptitude which helps ‘simulate what would happen without actually performing the operation’. This will work regardless of aptitude operation.
  • sudo aptitude -vs install <package> –  Adding the –v option along with –s gives even more detailed output.

The only sad thing is aptitude unlike Advanced Packaging Tool, “does not have Super Cow Powers”. In apt-get “super cow powers” can be found by issuing the command apt-get moo. But, in aptitude issuing moo will give the user a prompt saying there are no easter eggs. However, aptitude -v moo & aptitude -vv moo are fun 😀

Njoy Ubuntu!

About Cell aka Abhishek

A Technology Fanatic, Open-source lover, a future Entrepreneur, & an Innovative thinker, is presently working as a R&D Engineer in the Wind Turbine Industry.