aptitude

aptitude is a front-end to the Advanced Packaging Tool (APT) in Debian and Debian-based distributions. This program allows users to view the list of packages and perform package management tasks such as installing, removing or upgrading packages. aptitude has an interactive mode similar to dselect, but it can be also used as a command-line tool, similar to apt-get.

To enter the menu-driven package management interface, type aptitude:

aptitude gui

We will describe how to install, remove or upgrade packages using this menu-driven interface.

Install packages

First, press u to update the list of packages available for installation. Then, navigate the menu and press + to select the packages you wish to install. You can search for a package by pressing the / key. After you have selected all the packages you wish to install, press g to begin downloading and installing the package files.

Here is how we can install nmap using aptitude:

First, we will search for nmap:

aptitude search

Then, we will select the nmap package by pressing the + key:

aptitude select for installation

To download and install nmap, press g:

aptitude install package

Upgrade packages

First, press u to update the list of packages available for installation. Next, press U to upgrade all packages which can be upgraded. Press g to download and install upgraded package files:

aptitude upgrade packages

Remove packages

Navigate the aptitude menu and press  to select the packages you wish to remove. Press g to begin removing the packages.

For example, to remove nmap, we would have to find the nmap package and press the  key to select it for the removal:

aptitude remove packages

We can then remove nmap by pressing g.

aptitude command line

You can also pass various commands to aptitude on the command line. aptitude emulates most apt-get command-line arguments, allowing it to act as a full replacement for apt-get. For example, to search for a package, we can type aptitude search PACKAGE_NAME:

aptitude search command

We can update package lists from the APT repositories by typing the aptitude update command:

aptitude update command

To install a package, we can use the aptitude install PACKAGE_NAME command:

aptitude install command

To upgrade software packages, we can use the aptitude full-upgrade command:

aptitude full upgrade command

To remove all downloaded packages, we can use the aptitude clean command:

aptitude clean command

Geek University 2022