Combining patterns in aptitude package search

To find packages which contain multiple terms in their descriptions ("imap" and "sync", in this case), could use any of the following:

aptitude search "?description("imap") ?description("sync")"
aptitude search '?description("imap") ?description("sync")'
aptitude search ~dimap~dsync
aptitude search ~d"imap"~d"sync"
aptitude search ~d\imap~d\sync

Exclude a term with "!". To keep the shell from evaluating it, enclose the whole pattern in quotes. The following will find all packages with words "imap" and "sync" but not "library" in their descriptions:

aptitude search '~d"imap"~d"sync"!~d"library"'

Alternatively, could escape the exclamation mark instead of enclosing the whole pattern in quotes:

For more info, install the aptitude manual ("aptitude install aptitude-doc-en") and read "/usr/share/doc/aptitude/html/en/index.html".

1 Comment

  • 1. John Mills replies at 8th August 2013, 11:49 pm :

    This gave me the clue! aptitude-doc-en didn’t.
    (whitespace matters in search for two terms in description).
    aptitude search ~dgis~dgeo|wc -l
    78
    aptitude search ~dgis ~dgeo|wc -l
    960

    Thank you
    John Mills

Leave a comment

NOTE: Enclose quotes in <blockquote></blockquote>. Enclose code in <pre lang="LANG"></pre> (where LANG is one of these).