Now that you can move about the list of packages, it's time to start using aptitude to install and remove packages. In this section you will learn how to flag packages for installation, deletion, and upgrade.
![]() | Tip |
---|---|
You can only change your system's setup as the |
All changes to a package are performed by first highlighting it in the package list, then pressing a key corresponding to the action which should be performed. The basic action keys [2] are + to install or upgrade a package, - to remove a package, and = to prevent a package from being automatically upgraded (this is known as holding the package). These actions are not performed immediately; aptitude will simply update the package list to show the change that has been requested.
For instance, in the screen shot below, the
kaffeine
package was selected and
+ was pushed. The package is now
highlighted in green and the letter “i” has
appeared to the left of its name, to indicate that it will
be installed; in addition, an estimate of the amount of
space that the package will use is displayed.
![]() | Tip |
---|---|
At any time, you can use Control+u) to “undo” any change to one or more packages. This is very useful if an action has unforseen consequences and you want to “take it back”. → ( |
In addition to actions that affect individual packages, another important action is available: typing U will attempt to upgrade any packages that can be upgraded. You should use this command on a regular basis to keep your system up-to-date.
Sometimes, changing a package's state will cause dependency
relationships to become unfulfilled; packages with
unfulfilled dependencies are said to be
broken. aptitude will warn you
when this happens, and explain why it occured. For
instance, here is what happens if I attempt to remove
libexif1
:
As you can see, aptitude displays three indicators that
something has gone wrong: first, the number of broken
packages is displayed in the upper blue area; second, the
lower half of the display changes to describe broken
packages that are related to the currently highlighted
package; third, a bar appears at the bottom of the screen
with a suggestion on how to solve the problem. To quickly
find broken packages in the package list, you can press
b or search for ~b
.
To see more information about how aptitude thinks you can solve this problem, press e. You can see more solutions by pressing .; once you have done so, you can return to solutions you skipped past by pressing ,. Finally, when you have found a solution that you are satisfied with, you can press ! to execute it.
For instance, in the following screen-shot, I have decided
that I really want to remove
libexif1
, even if it means that the
digikam
package must also be
removed. Pressing ! or selecting the
“Apply” button will flag
digikam
for removal, resolving the
broken dependency.
If you do not resolve the situation, aptitude will try to fix things for you when you commit your selections by pressing g. However, it is hard to automatically solve dependency problems, and you may not be happy with the results, so it is generally better to solve problems such as this before committing your selections.
[2] You can also change packages using the menu; see the section called “The Package Menu” for details.