Table 2.3, “Quick guide to search terms” provides a brief summary of all the search terms provided by aptitude. A full description of each term can be found below.
Table 2.3. Quick guide to search terms
Long form | Short form | Description |
---|---|---|
|
Select the package bound to
variable ; see the section called “Explicit search targets”.
| |
| ! |
Select any package that does not match
pattern .
|
| ~aaction |
Select packages that have been marked for the given
action (e.g.,
“install ” or
“upgrade ”).
|
|
Select packages whose versions all match
pattern .
| |
| pattern1 pattern2 |
Select any package that matches both
pattern1 and
pattern2 .
|
|
Select packages for which at least one version
matches pattern .
| |
| ~rarchitecture |
Select packages for the given architecture (such as
“amd64 ”, or
“all ”). Special values:
native and foreign .
|
|
~A
|
Select packages from the given archive (such as
“unstable ”).
|
| ~M | Select packages that were automatically installed. |
|
?
|
Selects anything if
variable matches
pattern ; see the section called “Explicit search targets”.
|
| ~b | Select packages that have a broken dependency. |
| ~B |
Select package that have a broken dependency of the
given depType .
|
| ~DB[ |
Select packages that have a broken dependency of the
given depType matching
pattern .
|
| ~RB |
Select packages that a package matching
pattern declares a broken
dependency of type depType .
|
| ~C |
Select packages that conflict with a package
matching pattern .
|
| ~c | Select packages that were removed but not purged. |
| ~D[ |
Match packages that declare a dependency of type
depType on a package
matching pattern .
|
| ~d |
Select packages whose description matches
description .
|
| ~E |
Select essential packages, those with
Essential: yes in their control
files.
|
|
Select packages named
name .
| |
| ~F | Select no packages. |
|
Select packages that match
pattern with
variable bound to the
package being matched; see the section called “Explicit search targets”.
| |
| ~g | Select packages that are not required by any manually installed package. |
| ~i | Select installed packages. |
| ~m |
Select packages maintained by
maintainer .
|
|
Select packages with a multi-arch capability of
multiarch (that is, either
“foreign ”,
“same ”,
“allowed ”, or
“none ”).
| |
| ~S |
Select packages for which a single version matches
both filter and
pattern .
|
| ~n ,
|
Select packages with the given name .
|
| ~N | Select new packages. |
| ~o | Match installed packages that cannot be downloaded. |
|
|
Select packages that match
pattern1 ,
pattern2 , or both.
|
| ~O |
Select packages with the given
origin .
|
| ~P |
Select packages that provide a package matching
pattern .
|
| ~p |
Select packages with the given priority .
|
| ~R[ |
Select packages that are the targets of a dependency
of type depType declared
by a package matching
pattern .
|
| ~RB |
Select packages that are the targets of a broken
dependency of type
depType declared by a
package matching pattern .
|
| ~s |
Select packages in the given section .
|
| ~e |
Select packages whose source package name matches
the regular expression
name .
|
|
Select packages whose source version matches the
regular expression version .
| |
| ~G |
Select packages that have the given debtags
tag .
|
|
Full-text search for packages that contain the given
keyword .
| |
|
Full-text search for packages that contain a keyword
that begins with the given
keyword .
| |
| ~T | Select all packages. |
| ~t |
Select packages that are in the given
task .
|
| ~U | Select packages that are installed and can be upgraded. |
|
Select packages that are marked with a user-tag
matching the regular expression
user-tag .
| |
| ~V |
Select packages whose version matches
version (special values:
CURRENT ,
CANDIDATE , and
TARGET ).
|
| ~v | Select virtual packages. |
| ~W |
Select versions for which
pattern matches any version
of the corresponding package, discarding local
version restrictions.
|
name
Matches packages whose names match the regular
expression name
. This is the
“default” search mode and is used for patterns that
don't start with ~
.
?=variable
Matches packages that correspond to the value of
variable
, which must be bound
by an enclosing ?for
. For instance,
will match any
package ?for
x:
?depends
( ?recommends
( ?=x ) )x
that depends on a
package which recommends x
.
For instance, the following search expression matches packages that conflict with themselves:
See the section called “Explicit search targets” for more information.
?not(pattern
)
, !pattern
Matches packages which do not match
the pattern pattern
. For
instance,
“?not(
”
selects packages that are not “broken”.
?broken
)
Note | |
---|---|
To include a “!” in a search string, it
must be “escaped” by placing a tilde
(“ |
?and(pattern1
, pattern2
)
, pattern1
pattern2
Matches packages that match both
pattern1
and
pattern2
.
?or(pattern1
, pattern2
)
, pattern1
| pattern2
Matches packages that match either
pattern1
or
pattern2
.
Note | |
---|---|
To use the character “|” in a regular expression, it
must be “escaped” to prevent aptitude from creating
an OR term from it: “ |
(pattern
)
Matches pattern
. For instance,
“opengl (perl|python)
”
matches any package whose name contains
opengl
, and also contains either
perl
or python
.
?action(action
)
, ~aaction
Matches packages upon which the given
action
is going to be
performed. action
can be
“install
”,
“upgrade
”,
“downgrade
”,
“remove
”,
“purge
”,
“hold
” (tests whether a
package has been placed on hold), or
“keep
” (tests whether a
package will be unchanged).
Note | |
---|---|
Note that this only tests whether an action is actually
queued up to be performed on a package, not whether it
could be performed. Thus, for
instance, |
?all-versions(pattern
)
Matches any package whose versions all match the given
expression. Each version of a package will be
separately tested against
pattern
, and the package will
match if all of its versions match. Packages without
versions, such as virtual packages, will always be
matched by this search term.
This term may not be used in a context in which the
versions to match against have already been narrowed,
such as within ?depends
or ?narrow
. However, it may
always be used within ?widen
.
?any-version(pattern
)
Matches a package if any one of its versions matches the
enclosed pattern. This is the dual to ?all-versions
.
This term may not be used in a context in which the
versions to match against have already been narrowed,
such as within ?depends
or ?narrow
. However, it may
always be used within ?widen
.
Note | |
---|---|
This term is closely related to |
Note | |
---|---|
To be precise, as with any other pattern, it is not packages but
versions of the packages which are matched. For
“ |
?architecture(architecture-spec
)
, ~rarchitecture-spec
Matches package versions for the given
architecture-spec
. For instance,
“?architecture(amd64)
” matches
amd64
packages, while
“?architecture(all)
” matches
arch-independent packages.
It also accepts the special values native
and
foreign
, and architecture wildcards
(e.g. linux-any
or
any-amd64
), as specified in Policy (“11.1
Architecture specification strings”).
?archive(archive
)
, ~Aarchive
Matches package versions which are available from an
archive that matches the regular expression
archive
. For instance,
“?archive(testing)
”
matches any package available from the
testing
archive.
?automatic
, ~M
Matches packages which were automatically installed.
?bind(variable
,
pattern
)
,
?variable
:term-name
[(args
)]
Matches any package or version if the given
pattern
matches the package or
version bound to variable
,
which must be defined in an enclosing ?for
.
The two search patterns in the above example both match
any package x
such that
x
depends on a package
y
which in turn depends on a package
z
such that x
also
depends directly on z
. The first
pattern uses ?bind
directly, while
the second one uses an equivalent shorthand syntax.
See the section called “Explicit search targets” for more information.
?broken
, ~b
Matches packages that are “broken”: they have an unfulfilled dependency, predependency, breaks, or conflict.
?broken-depType
, ~BdepType
Matches packages which have an unfulfilled (“broken”)
dependency of the given depType
.
depType
can be
“depends
”,
“predepends
”,
“recommends
”,
“suggests
”,
“breaks
”,
“conflicts
”, or
“replaces
”.
?broken-depType
(pattern
)
, ~DB[depType
:]pattern
Matches packages with an unsatisfied dependency of type
depType
on a package matching
pattern
.
depType
may be any one of the
dependency types listed in the documentation of
?broken-
.
depType
?conflicts(pattern
)
, ~Cpattern
Matches packages which conflict with a package matching
the given pattern
. For
instance,
“?conflicts(
”
matches any package which conflicts with a package I
maintain.
?maintainer
(dburrows@debian.org))
?config-files
, ~c
Matches packages which have been removed, but whose configuration files remain on the system (ie, they were removed but not purged).
?depType
(pattern
)
, ~D[depType
:]pattern
depType
may be any one of the
dependency types given in the documentation of
?broken-
,
as well as depType
provides
: for instance,
will match any
package that depends on ?depends
(libpng3)libpng3
. If
the short form (~D
) is used and
depType
is not present, it
defaults to depends
.
If depType
is
“provides
”, matches
packages that provide a package matching
pattern
(the equivalent of
?provides
). Otherwise, matches packages which declare
a dependency of type depType
upon a package version which matches
pattern
.
?description(description
)
, ~ddescription
Matches packages whose description matches the regular
expression description
.
?essential
, ~E
Matches Essential packages.
?exact-name(name
)
Matches packages named name
.
This is similar to ?name
, but the name must match
exactly. For instance, the following pattern will match
only the package apt
; with
?name
, it would also match
aptitude
,
uvccapture
, etc.
?false
, ~F
This term does not match any package. [18]
?for variable
: pattern
Matches pattern
, but the given
variable
may be used inside
pattern
to refer to the package
or package version this term to.
You can use variable
in two
ways. To apply a ?
-style term to
the variable, write
?
;
for instance, variable
:term-name
(args
)?x:depends(apt)
. In
addition, the term
will select any package or version that matches the
value of the given ?=
variable
variable
.
For instance, the following term will match any package
x
that both depends and recommends a
second package y
.
See the section called “Explicit search targets” for more information.
?garbage
, ~g
Matches packages which are not installed, or which were automatically installed and are not depended upon by any installed package.
?installed
, ~i
Matches package versions which are currently installed.
Since all versions are tested by default, this normally matches packages which are currently installed.
?maintainer(maintainer
)
, ~mmaintainer
Matches packages whose Maintainer field matches the
regular expression
maintainer
. For instance,
“
”
will find all packages maintained by Joey Hess.
?maintainer
(joeyh)
?multiarch(multiarch
)
Matches packages with the multi-arch capability
specified by multiarch
. For instance,
“
”
will find all packages which can satisfy dependencies of
packages for another architecture.
“?multiarch
(foreign)
”
will select packages with no multi-arch capability.
?multiarch
(none)
?narrow(filter
, pattern
)
, ~S filter
pattern
This term “narrows” the search to package
versions matching filter
. In
particular, it matches any package version which matches
both filter
and
pattern
. The string value of
the match is the string value of
pattern
.
?name(name
)
, ~nname
Matches packages whose name matches the regular
expression name
. For
instance, most of the packages that match
“
” are
libraries of one sort or another.
?name
(^lib)
?new
, ~N
Matches packages which are “new”: that is,
they have been added to the archive since the last time
the list of packages was cleared using → (f)
or the command-line action forget-new
.
?obsolete
, ~o
This term matches any installed package which is not available in any version from any archive. These packages appear as “Obsolete or Locally Installed” in the visual interface.
?origin(origin
)
, ~Oorigin
Matches package versions whose origin matches the
regular expression origin
.
For instance,
“!?origin(debian)
” will
find any unofficial packages on your system (packages
not from the Debian archive).
?provides(pattern
)
, ~Ppattern
Matches package versions which provide a package that
matches the pattern
. For
instance,
“?provides(mail-transport-agent)
”
will match all the packages that provide
“mail-transport-agent
”.
?priority(priority
)
, ~ppriority
Matches packages whose priority is
priority
;
priority
must be
extra
, important
,
optional
,
required
, or
standard
. For instance,
“?priority(required)
”
matches packages whose priority is
“required
”.
?reverse-depType
(pattern
)
, ~R[depType
:]pattern
depType
may be either
“provides
” or one of the
dependency types given in the documentation of
?broken-
.
If depType
depType
is not present, it
defaults to depends
.
If depType
is
“provides
”, matches
packages whose name is provided by a package version
matching pattern
. Otherwise,
matches packages which a package version matching
pattern
declares a dependency of
type depType
upon.
?reverse-broken-depType
(pattern
)
, ?broken-reverse-depType
(pattern
)
, ~RB[depType
:]pattern
depType
may be either
“provides
” or one of the
dependency types given in the documentation of
?broken-
.
If depType
depType
is not present, it
defaults to depends
.
Matches packages which a package version matching
pattern
declares an unsatisfied
dependency of type depType
upon.
?section(section
)
, ~ssection
Matches packages whose section matches the regular
expression section
.
?source-package(name
)
, ~ename
Matches packages whose source package name matches the
regular expression name
.
?source-version(version
)
Matches packages whose source version matches the
regular expression version
.
?tag(tag
)
, ~Gtag
Matches packages whose Tag field matches the regular
expression tag
. For
instance, the pattern
?tag(game::strategy)
would match
strategy games.
For more information on tags and debtags, see http://debtags.alioth.debian.org.
?task(task
)
, ~ttask
Matches packages that appear in a task whose name
matches the regular expression
task
.
?term(keyword
)
This term performs a full-text search for
keyword
in the apt package
cache. When used with “aptitude
search
”, l) in the
curses front-end, or typed into a package search box in
the GTK+ front-end, this term will allow → (aptitude to
accelerate the search using a Xapian index.
?term-prefix(keyword
)
This term performs a full-text search for any keyword
beginning with keyword
in the
apt package cache. When used with
“aptitude search
”, l) in the
curses front-end, or typed into a package search box in
the GTK+ front-end, this term will allow → (aptitude to
accelerate the search using a Xapian index.
This is similar to ?term
, but matches extensions of
the keyword
. For instance,
the following search pattern will match any package
indexed under the keywords hour
,
hourglass
, hourly
,
and so on:
?true
, ~T
This term matches any package. For instance,
“
”
matches installed packages which provide any package.
?installed
?provides
(?true
)
?upgradable
, ~U
This term matches any installed package which can be upgraded.
Note | |
---|---|
Note that this only tests whether there are upgrades available
for a package, not whether an upgrade could
be performed (with actions such as
For instance, there can be upgrades available for several packages, but maybe the upgraded versions of a subset conflict with each other, so they cannot be co-installed or not all of them upgraded at the same time. |
?user-tag(tag
)
This term matches any package that is marked with a
user-tag matching the regular expression
tag
.
?version(version
)
, ~Vversion
Matches any package version whose version number matches
the regular expression
version
, with the exceptions
noted below. For instance,
“?version(debian)
”
matches packages whose version contains
“debian
”.
The following values of
version
are treated
specially. To search for version numbers containing
these values, preface the value with a backslash; for
instance, to find packages whose version number contains
CURRENT
, search for
\CURRENT
.
CURRENT
matches the currently
installed version of a package, if any.
CANDIDATE
matches the version,
if any, of the package that will be installed if
you press + on the package or run
aptitude install
on it.
TARGET
matches the version of a
package that is currently targeted for
installation, if any.
?virtual
, ~v
Matches any package which is purely virtual: that is, its name is
provided by a package, but no package of that name exists. For
instance,
“?virtual
”
matches virtual packages which are provided by any installed
package.
?reverse-provides
(?installed
)
?widen(pattern
)
, ~Wpattern
“Widens” the match: if the versions to
match against have been limited by an enclosing term
(such as ?depends
), these limits are dropped. Thus,
matches a package version if
?widen
(pattern
)pattern
matches
any version of that package.