info > APT-PATTERNS

๐Ÿ“˜ NAME

apt-patterns โ€” Syntax and semantics of apt search patterns

๐Ÿš€ Quick Reference

Use CaseCommandDescription
๐Ÿ” Search by package nameapt list '?name(REGEX)'Find packages matching a regular expression
๐Ÿ—‘๏ธ Remove automatically installed & orphanedapt remove ?garbageSame as apt autoremove
๐Ÿงน Purge config-file leftoversapt purge ?config-filesRemove packages with only residual config
๐Ÿ“‹ List manually installed packages by sectionapt list '~i !~M (~slibs|~sperl|~spython)'Filter by section regex
โฌ†๏ธ Find upgradable packagesapt list ?upgradablePackages with newer candidates
๐Ÿ’ฃ Find broken dependenciesapt list ?brokenPackages with broken dependency chains
๐Ÿ›๏ธ Filter by architectureapt list '?architecture(amd64)'Using wildcards supported
๐Ÿ”— Combined logical patternsapt list '?and(?installed,?upgradable)'AND/OR/NOT nesting

๐Ÿ“– 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.

๐ŸŽฏ NARROWING PATTERNS

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.

๐Ÿ“ฆ PACKAGE PATTERNS

These patterns select specific packages.

๐Ÿ”ข VERSION PATTERNS

These patterns select specific versions of a package.

๐Ÿ”— PACKAGE RELATIONSHIP PATTERNS

These patterns match specific package versions that depend/conflict with some other packages.

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

Remove all automatically installed & no-longer-needed packages (same as apt autoremove):
apt remove ?garbage
Purge all packages that only have configuration files left:
apt purge ?config-files
List all manually-installed packages in sections matching libs, perl, or python:
apt list '~i !~M (~slibs|~sperl|~spython)'

๐Ÿ”„ MIGRATING FROM APTITUDE

Patterns in apt are heavily inspired by patterns in aptitude, but with some tweaks:

๐Ÿ“š SEE ALSO

๐Ÿ› 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 <apt@packages.org>.

๐Ÿ‘ฅ AUTHORS

๐Ÿ“ NOTES

  1. APT bug page: http://bugs.debian.org/src:apt

APT 2.4.14 ยท 26 December 2021 ยท APT-PATTERNS(7)

APT-PATTERNS
๐Ÿ“˜ NAME ๐Ÿš€ Quick Reference ๐Ÿ“– DESCRIPTION ๐Ÿงฉ LOGIC PATTERNS ๐ŸŽฏ NARROWING PATTERNS ๐Ÿ“ฆ PACKAGE PATTERNS ๐Ÿ”ข VERSION PATTERNS ๐Ÿ”— PACKAGE RELATIONSHIP PATTERNS ๐Ÿ’ก EXAMPLES ๐Ÿ”„ MIGRATING FROM APTITUDE ๐Ÿ“š SEE ALSO ๐Ÿ› BUGS ๐Ÿ‘ค AUTHOR ๐Ÿ‘ฅ AUTHORS ๐Ÿ“ NOTES

Generated by phpman v4.9.26-1-g511901d Author: Che Dong Under GNU General Public License
2026-08-09 09:01 @2600:1f28:365:80b0:50b3:453e:ff52:20f7
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format