I've looked at an aptitude tutorial and read the man page, but I just don't get it. After you launch aptitude, how do you say "install package foo"? Or search for all packages with "foo" in their name?
I've looked at an aptitude tutorial and read the man page, but I just don't get it. After you launch aptitude, how do you say "install package foo"? Or search for all packages with "foo" in their name?
After running aptitude, use these key commands as found at Using aptitude GUI style: (If you use Bionic, use CTRL+T instead of F10)
The common use of aptitude in TUI (text user interface) is:
Some time when you need to resolve conflicts, you discover that you made a mistake;
you can easily use 'Cancel pending actions' in the 'Actions' menu so that you can re-select.
When reviewing pending actions:
Using aptitude from the command line like apt-get
To install a package on a console run:
To search packages:
For example, let's say you want to install Pidgin
Search:
Install:
To search for a package, hit
/
and enter a part of the package name you want to search (regexps can be used). This is similar to search in editors like vim.You can use the up- and down-arrow keys for browsing, together with enter for toggling the tree nodes.
When you have found the right package, hit
+
to mark it for installation (it will be shown in green and you see ani
as the second character in the status column). Then typeg
(for "go") to get to the preview screen showing all pending changes. A secondg
will start the installation.You can also use enter when on a package to open a window with details of the package.
When there are more than one windows open in aptitude (like the package details and preview windows), you switch between them with
F6
andF7
, and close the current window withq
.With
aptitude
you can use the ncurses based console in the terminal (see the other answers for that) or use all of its options on the command line. I usually use the latter method, as I'll demonstrate using the example of thecheese
package:(Before using any of the
aptitude
install commands in this article it is worth runningsudo aptitude update
to refresh the list of available software.)To search for a package, use
Then to show all the package information concerning versions and dependencies, type
Then to install it use
However, beyond the standard basic usage of searching, removing, and installing packages,
aptitude
can install and remove packages with one command. Withaptitude
install commands add-
after the package name to have it removed, and with aptitude remove commands add+
after the package name to have it installed.If you enter
cheese
will be installed whilegthumb
will be removed.However, on the other hand, if you use
htop
will be removed andgrsync
installed.Source: see the Debian handbook for more information on
aptitude
. For another essential explanation ofaptitude
and its other useful commands, seeman aptitude
or the Ubuntu manpages online.