dpkg-query -l 'libc6*'
The first three columns of the output show the desired action, the package status, and errors, in that order.
Desired action:
u = Unknown i = Install h = Hold r = Remove p = Purge
Package status:
n = Not-installed c = Config-files H = Half-installed U = Unpacked F = Half-configured W = Triggers-awaiting t = Triggers-pending i = Installed
Error flags:
<empty> = (none) R = Reinst-required
An uppercase status or error letter indicates the package is likely to cause severe problems. Please refer to dpkg(1) for information about the above states and flags.
The output format of this option is not configurable, but varies automatically to fit the terminal width. It is intended for human readers, and is not easily machine-readable. See -W (--show) and --showformat for a way to configure the output format.
Warning: this command is deprecated as it gives direct access to the internal dpkg database, please switch to use --control-list and --control-show instead for all cases where those commands might give the same end result. Although, as long as there is still at least one case where this command is needed (i.e. when having to remove a damaging postrm maintainer script), and while there is no good solution for that, this command will not get removed.
If the first character in the filename-search-pattern is none of '*[?/' then it will be considered a substring match and will be implicitly surrounded by '*' (as in *filename-search-pattern*). If the subsequent string contains any of '*[?\', then it will handled like a glob pattern, otherwise any trailing '/' or '/.' will be removed and a literal path lookup will be performed.
This command will not list extra files created by maintainer scripts, nor will it list alternatives.
Users of APT-based frontends should use apt-cache show package-name instead as the available file is only kept up-to-date when using dselect.
In the format string, "\" introduces escapes:
\n newline \r carriage return \t tab
"\" before any other character suppresses any special meaning of the following character, which is useful for "\" and "$".
Package information can be included by inserting variable references to package fields using the syntax "${field[;width]}". Fields are printed right-aligned unless the width is negative in which case left alignment will be used. The following fields are recognized but they are not necessarily available in the status file (only internal fields or fields stored in the binary package end up in it):
Architecture Bugs Conffiles (internal) Config-Version (internal) Conflicts Breaks Depends Description Enhances Essential Filename (internal, front-end related) Homepage Installed-Size MD5sum (internal, front-end related) MSDOS-Filename (internal, front-end related) Maintainer Origin Package Pre-Depends Priority Provides Recommends Replaces Revision (obsolete) Section Size (internal, front-end related) Source Status (internal) Suggests Tag (usually not in .deb but in repository Packages files) Triggers-Awaited (internal) Triggers-Pending (internal) Version
The following are virtual fields, generated by dpkg-query from values from other fields (note that these do not use valid names for fields in control files):
dpkg-query -W -f='${binary:Package} ${Version}\t${Maintainer}\n' dpkg