Launching Aptitude with
no command-line options, will give you a menu-driven, text-based front-end to
theAdvanced Packaging Tool (APT) system. Many of the common package
management functions, such as installation, removal, and upgrade, can be
performed in Aptitude with single-key commands, which are typically
lowercase letters.
Aptitude is best
suited for use in a non-graphical terminal environment to ensure proper
functioning of the command keys. You may start the menu-driven interface of Aptitude as
a normal user by typing the following command at a terminal prompt:
sudo aptitude
When Aptitude starts,
you will see a menu bar at the top of the screen and two panes below the menu
bar. The top pane contains package categories, such as New Packages and Not
Installed Packages. The bottom pane contains information related to the
packages and package categories.
Using Aptitude for
package management is relatively straightforward, and the user interface makes
common tasks simple to perform. The following are examples of common package
management functions as performed in Aptitude:
1. Install
Packages: To install a package, locate the package via the Not Installed
Packages package category, by using the keyboard arrow keys and the ENTER key.
Highlight the desired package, then press the + key. The package
entry should turn green, indicating that it has been marked for
installation. Now press g to be presented with a summary of package
actions. Press g again, and downloading and installation of the
package will commence. When finished, press ENTER, to return to the menu.
2.
Remove
Packages: To remove a package, locate the package via the Installed
Packages package category, by using the keyboard arrow keys and the ENTER key.
Highlight the desired package you wish to remove, then press the - key.
The package entry should turn pink, indicating it has been marked for
removal. Now press g to be presented with a summary of package
actions. Press g again, and removal of the package will commence. When
finished, press ENTER, to return to the menu.
3.
Update
Package Index: To update the package index, simply press the u key.
Updating of the package index will commence.
4.
Upgrade
Packages: To upgrade packages, perform the update of the package index as
detailed above, and then press the U key to mark all packages with
updates. Now press g whereby you'll be presented with a summary of
package actions. Press g again, and the download and installation
will commence. When finished, press ENTER, to return to the menu.
The first
column of information displayed in the package list in the top pane, when
actually viewing packages lists the current state of the package, and uses the
following key to describe the state of the package:
1.
i:
Installed package
2.
c:
Package not installed, but package configuration remains on system
3.
p:
Purged from system
4.
v:
Virtual package
5.
B:
Broken package
6.
u:
Unpacked files, but package not yet configured
7.
C:
Half-configured - Configuration failed and requires fix
8.
H:
Half-installed - Removal failed and requires fix
To
exit Aptitude, simply press the q key and confirm you wish to exit.
Many other functions are available from the Aptitude menu by pressing theF10 key.
Command
Line Aptitude
You can also use Aptitude as
a command-line tool, similar to apt-get. To install the nmap package
with all necessary dependencies, as in the apt-getexample, you would use
the following command:
sudo aptitude install nmap
To remove the same package,
you would use the command:
sudo aptitude remove nmap
Consult the man pages for more
details of command line options for Aptitude.