According to the manual, it
search regex... search performs a full text search on all available package lists for the POSIX regex pattern given, see regex(7). It searches the package names and the descriptions for an occurrence of the regular expression and prints out the package name and the short description, including virtual package names. If --full is given then output identical to show is produced for each matched package, and if --names-only is given then the long description is not searched, only the package name is. [...] --names-only, -n Only search on the package names, not the long descriptions. Configuration Item: APT::Cache::NamesOnly.
However, I came across a strange situation:
$ apt-cache search --names-only 'kde*' | grep tkcv tkcvs - Graphical front-end to CVS and Subversion
Why in the world would the command above match
tk8.6-doc? Braiam and I spent a few minutes chatting about this and he noticed that
$ apt-cache show tkcvs | grep -i kd Replaces: tkdiff Provides: tkdiff
So, Braiam suggested that it's matching the
Replaces field as well which makes a certain amount of sense in the case of changing package names. OK then, but what about:
$ apt-cache search --names-only 'kde*' | grep tk8.6 tk8.6-doc - Tk toolkit for Tcl and X11, v8.6 - manual pages $ apt-cache show tk8.6-doc | grep -i kd Provides: tkdoc Conflicts: tkdoc
Here it is either matching the
Conflicts or the
Provides fields and I can't twist the meaning of
--names-only to make it match those fields. So, what exactly does
--names-only search through? Is it the names of all packages that are mentioned in a package's description? It is clearly not matching the package name alone.