Skip to content

Instantly share code, notes, and snippets.

@cmbaughman
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmbaughman/9793439 to your computer and use it in GitHub Desktop.
Save cmbaughman/9793439 to your computer and use it in GitHub Desktop.

Key commands available when a group is selected

[ - Expand the currently selected group, and all its subgroups

] - Collapse the currently selected group, and all its subgroups

Enter - Expand or collapse the currently selected group.

Key commands available when a package is selected

d - view the package dependencies (packages that this package uses)

r - view the reverse dependencies (packages that use this package)

Shift-c - download and view the changelog

Enter - view information about the selected package

Key commands available everywhere

u - update the package lists

j - move down one line

k - move up one line

q - retreat to the previous view (and exit aptitude if at the top view)

The navigation keys (PageUp, Home, PageDown, etc.) work pretty much as expected.

You can navigate through the dependencies of the packages available to you by selecting a package that interests you and following its dependencies or reverse dependencies. Repeat as desired.

Package Management

Aptitude provides straightforward package managment, and artistic use of the available actions (combined with apt-pinning, see PinningHowto) will help you manage unusual repositories, such as backports.

Most common actions on a package

  • (plus) mark package for installation
  • (minus) mark package for removal

_ (underscore) mark package for purging

= (equals sign) mark package as held

Committing your actions

Press g once to view the marked actions

Press g a second time to act

Searching for packages

/ - (forward slash) search forward for search term or partial package name

\ - (back slash) search backwards for search term or partial package name

l - (lower case L) limit the view to packages matching the search expression.

Useful search terms

~ is 'tilde'

~b - matches broken packages

~c - matches partially uninstalled packages ('configured, but not installed')

~ahold - matches held packages

~dtext - searches descriptions for text

~i - matches installed packages

Aptitude from the command line You can also run aptitude from the command line.

aptitude update

aptitude update

aptitude safe-upgrade

The safest way to upgrade (since Ubuntu 7.10) is to use the action 'safe-upgrade' as the previously used action 'upgrade' has been deprecated. The new action will upgrade a package only if it does not impact other packages, i-e: if it is necessary to add or remove a dependency package during upgrade, safe-upgrade won't upgrade.

aptitude safe-upgrade

If you want to force the upgrade anyway, the action 'full-upgrade' (previously known as 'dist-upgrade') can be used. With this command, aptitude will upgrade to the latest version of a package even if it is necessary to add or remove dependencies.

aptitude full-upgrade

aptitude search

Search for packages with "gnuplot" in the name

aptitude search gnuplot

Search for installed packages with "gnuplot" in the name

aptitude search '~ignuplot'

Search for packages from the section "gnome" that are not installed

aptitude search !isgnome

For more complex searches and processing, pipelines are your friend:

aptitude search '~i' | grep -ie 'x11|xorg' | less

How to free disk space

aptitude clean --purge-unused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment