Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 10 down vote accepted

After running aptitude, use these key commands as found at Using aptitude GUI style:

F10 to access the aptitude menu.

? this is to access "help"

Use 'up' , 'down' , 'left' , 'right' , to navigate.

Use Enter to select items.

Use + or - to install, update, or remove a package

Use g to preview or confirm actions

q to quit – this will also close the currently open window (g goes forward, q goes back)

The common use of aptitude in TUI (text user interface) is:

  1. run aptitude;
  2. press u (update the lists of available packages);
  3. press U (Mark all upgradable packages to be upgraded);
  4. (search/select some stuff to install, is optional);
  5. press g (to see the pending actions and modify if needed);
  6. press g (again, to start the download).

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:

a explicitly accepts an action (use again to unaccept)

r rejects an action

g again goes ahead with pending actions

Using aptitude from the command line like apt-get

To install a package on a console run:

aptitude install package name

To search packages:

aptitude search package name

For example, let's say you want to install Pidgin

Search:

aptitude search pidgin

Install:

aptitude install pidgin
share|improve this answer
add comment

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 an i as the second character in the status column). Then type g (for "go") to get to the preview screen showing all pending changes. A second g 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 and F7, and close the current window with q.

share|improve this answer
    
well, I can't think of anything to install! However, I'll check it out more later. Why don't the man pages say something simple like that? very well explained. –  Thufir Aug 17 '12 at 10:45
add comment

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 the cheese package:

(Before using any of the aptitude install commands in this article it is worth running sudo aptitude update to refresh the list of available software.)

To search for a package, use

aptitude search cheese

Then to show all the package information concerning versions and dependencies, type

aptitude show cheese

Then to install it use

sudo aptitude install cheese

However, beyond the standard basic usage of searching, removing, and installing packages, aptitude can install and remove packages with one command. With aptitude 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

sudo aptitude install cheese gthumb-

cheese will be installed while gthumb will be removed.

However, on the other hand, if you use

sudo aptitude remove grsync+ htop

htop will be removed and grsync installed.

Source: see the Debian handbook for more information on aptitude. For another essential explanation of aptitude and its other useful commands, see man aptitude or the Ubuntu manpages online.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.