Hi,
We have a file we want to use, but we don't know which package contain this file. How can we find the package containing this file? Read on....
Lets install equery.
So lets search and see if there is a package named equery:
$ eix equery
Well yes,
No matches found
So let us try search the description of packages for equery:
$ eix -S equery
[I] app-shells/gentoo-bashcomp
Available versions: 20090613 ~20091225
Installed versions: 20090613(14:24:23 01/04/10)
Homepage: http://www.gentoo.org/
Description: Gentoo-specific bash command-line completions (emerge, ebuild, equery, repoman, layman, etc)
Bash completion is not what we need.
So we left with using equery to search for equery ;-)
equery utility is installed in my computer so lets use it.
Let's run equery alone:
$ equery
!!! No command or unknown command given
Usage: equery <global-opts> command <local-opts>
where <global-opts> is one of
-q, --quiet - minimal output
-C, --nocolor - turn off colours
-h, --help - this help screen
-V, --version - display version info
-N, --no-pipe - turn off pipe detection
where command(short) is one of
belongs(b) <local-opts> files... - list all packages owning files...
changes(c) - not implemented yet
check(k) pkgspec - check MD5sums and timestamps of pkgspec's files
depends(d) <local-opts> pkgspec - list all direct dependencies matching pkgspec
depgraph(g) <local-opts> pkgspec - display a dependency tree for pkgspec
files(f) <local-opts> pkgspec - list files owned by pkgspec
glsa(a) - not implemented yet
hasuse(h) <local-opts> useflag - list all packages with useflag
list(l) <local-opts> pkgspec - list all packages matching pkgspec
size(s) <local-opts> pkgspec - print size of files contained in package pkgspec
stats(t) - not implemented yet
uses(u) <local-opts> pkgspec - display USE flags for pkgspec
which(w) pkgspec - print full path to ebuild for package pkgspec
The line:
belongs(b) <local-opts> files... - list all packages owning files...
Is what we want to use to search what package installs the utility equery. Perfect!
So we run:
$ equery belongs $(which equery)
[ Searching for file(s) /usr/bin/equery in *... ]
app-portage/gentoolkit-0.2.4.6.1-r1 (/usr/bin/equery)
Oh, ok, now we know that /usr/bin/equery is installed by app-portage/gentoolkit.
Now to use it, just
$ emerge -av app-portage/gentoolkit
and enjoy :-)
Kfir