Modifying package states

The following commands are available to modify the states of packages. Commands take effect the next time you perform an install run; until you do, all of these commands can be reversed using UndoUndo (Control+u).

To apply a command to a package, simply select the package in a package list and issue the command. These commands can also be applied to groups of packages by selecting the group header (for instance, “Upgradable Packages”) and issuing the command.

CommandDescription
Install: PackageInstall (+)

Flag the current package for installation.

If the package is not installed, it will be installed. If it is already installed, it will be upgraded if possible and any sticky upgrade prevention that is in effect (eg, Hold) will be cancelled.

Remove: PackageRemove (-)

Flag the currently selected package for removal.

If the package is installed, it will be removed.

Purge: PackagePurge (_)

Flag the current package to be purged.

If the package is installed, it will be removed. Futhermore, even if it is removed, any remaining files (such as configuration files) related to the package will be removed from the system.

Keep: PackageKeep (:)

Flag the current package to be kept at its current version.

Any action that was to be performed on the package -- installation, removal, or upgrade -- is cancelled, and any persistent hold that was set on the package is removed.

Hold: PackageHold (=)

Set a persistent hold on the package.

As with Keep, any action that was to be performed on the package is cancelled. In addition, the package will not be automatically upgraded [a] until the hold is removed. You may cancel a hold by issuing the Install command.

PackageForbid Version (F)

The package will not be automatically upgraded[a] to the version it would currently be upgraded to. If it was going to be upgraded, the upgrade will be cancelled.

If you issue this command on a particular version of a package, the package will not be upgraded to the selected version. Note that only one version can be forbidden at once.

This functionality is largely provided as a convenience for users of the “unstable” distribution, so they can avoid known-bad versions of packages.

Reinstall: press L

Reinstalls the package.

Note that the reinstallation will not be saved when you quit aptitude or perform an install run for technical reasons. (essentially, the underlying software layers (dpkg and apt) do not provide any way to find out whether a reinstallation was successful or not).

PackageMark Auto (M), PackageMark Manual (m) Sets whether the package is treated as having been automatically installed; automatically installed packages will be removed when no other package requires them. For more information, see the section called “Managing automatically installed packages”.

[a] That is, it will be unaffected by ActionsMark Upgradable (U) or the full-upgrade or safe-upgrade command-line actions.

In addition to these commands that affect the selected package, there are two commands that affect large numbers of packages at once regardless of what is selected. ActionsForget new packages (f) clears the “new” status of all packages in the package list, and ActionsMark Upgradable (U) flags every package which can be upgraded for upgrade, except for packages that are held back or would be upgraded to a forbidden version.

[Note]Note

All changes to package states are saved when you quit aptitude, update the package list, or perform an install run. If you do not wish to save your changes, you can always abort aptitude by pressing Ctrl-C.