I see that dpkg has a "Provides" field for packages.
$ apt-cache show vim-tiny | grep Provides
Provides: editor
$
How do I know which packages provide i.e. "editor"?
I see that dpkg has a "Provides" field for packages.
$ apt-cache show vim-tiny | grep Provides
Provides: editor
$
How do I know which packages provide i.e. "editor"?
Aptitude provides this functionality as well. So a command like this will show all the packages that provide an editor.
You can even add other constraints. Like show only installed editors.
You can achieve the desired effect without
aptitude
(which appears to be discouraged these days) by usingapt-cache showpkg
, which includes a listing ofReverse Provides
. Piping it through a smallsed
script will get rid of the other things:A slightly prettier (but longer to type) example (lists package names only, not versions, and sorts them alphabetically) can be achieved with
awk
:...and this can be piped through
uniq
to remove duplicates (which may exist due to multiple versions of package being reverse-provides). Note that the use ofuniq
won't help with the first version, asuniq
only removes duplicates if they're on adjacent lines and thesed
version doesn't sort the output.Finally, one can define a function for easier use, as follows:
Stick this in (for example)
.bashrc
, so that it'll load when the shell does, and it becomes possible to runprovides <package>
to get a package's reverse-provides.Reading the database directly:
Usage:
base on your example. I can list package provide
editor
by useapropos