| 1. | APT bug page |
NAME
apt-patterns - Syntax and semantics of apt search patterns
DESCRIPTION
Starting with version 2.0, APT provides support for patterns, which can be used to query the apt cache for packages.
LOGIC PATTERNS
These patterns provide the basic means to combine other patterns into more complex expressions, as well as ?true and ?false patterns.
?and(PATTERN, PATTERN, ...), PATTERN PATTERN ...
?false, ~F
?not(PATTERN), !PATTERN
?or(PATTERN, PATTERN, ...), PATTERN | PATTERN | ...
?true, ~T
(PATTERN)
NARROWING PATTERNS
?all-versions(PATTERN)
?any-version(PATTERN)
For example, while ?and(?version(1),?version(2)) matches a package which has one version containing 1 and one version containing 2, ?any-version(?and(?version(1),?version(2))) restricts the ?and to act on the same version.
?narrow(PATTERN...)
PACKAGE PATTERNS
These patterns select specific packages.
?architecture(WILDCARD), ~rWILDCARD
?automatic, ~M
?broken, ~b
?config-files, ~c
?essential, ~E
?exact-name(NAME)
?garbage, ~g
?installed, ~i
?name(REGEX), ~nREGEX
?obsolete, ~o
?phasing
?upgradable, ~U
?virtual, ~v
VERSION PATTERNS
These patterns select specific versions of a package.
?archive(REGEX), ~AREGEX
?codename(REGEX)
?installed, ~i
?origin(REGEX), ~OREGEX
?section(REGEX), ~sREGEX
?source-package(REGEX), ~eREGEX
?source-version(REGEX)
?version(REGEX), ~VREGEX
?priority(NAME), ~pNAME
?security
PACKAGE RELATIONSHIP PATTERNS
These patterns match specific package versions that depend/conflict with some other packages.
?depends(PATTERN), ~DPATTERN, ?pre-depends(PATTERN), ~DPre-Depends:PATTERN, ?suggests(PATTERN), ~DSuggests:PATTERN, ?recommends(PATTERN), ~DRecommends:PATTERN, ?conflicts(PATTERN), ~DConflicts:PATTERN, ?replaces(PATTERN), ~DReplaces:PATTERN, ?obsoletes(PATTERN), ~DObsoletes:PATTERN, ?breaks(PATTERN), ~DBreaks:PATTERN, ?enhances(PATTERN), ~DEnhances:PATTERN
?reverse-depType(PATTERN), ~RDepType:PATTERN
depType is one of the dependency types such as depends, so that we don't have to repeat the entire list from the first paragraph here.
EXAMPLES
apt remove ?garbage
apt purge ?config-files
apt list '~i !~M (~slibs|~sperl|~spython)'
MIGRATING FROM APTITUDE
Patterns in apt are heavily inspired by patterns in aptitude, but with some tweaks:
In aptitude, a syntactic form "?foo(bar)" could mean "?and(?foo,bar)" if foo does not take an argument. In APT, this will cause an error.
SEE ALSO
apt-get(8), apt(8)
BUGS
APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.
AUTHOR
APT was written by the APT team <[email protected]>.
AUTHORS
Jason Gunthorpe
APT team
NOTES
- 1.
APT bug page