qdepends
Section: qdepends (1)
Updated: Feb 2026
Index
Return to Main Contents
NAME
qdepends - show dependency info
SYNOPSIS
qdepends
[opts] <pkgname>
DESCRIPTION
The
qdepends
applet has two different modes, forward and reverse dependency querying.
Default operation is forward mode, answering the queries "what does
package X depend on", while reverse mode answers "what packages depend
on X". Both modes can be further specified into build (DEPEND), run
(RDEPEND), post (PDEPEND), EAPI7's build (BDEPEND) and EAPI8's
instal-time (IDEPEND) dependencies.
By default,
qdepends returns the unique set of atoms that match
all dependency variables. To split this out per variable, use
-v
option.
Currently,
qdepends
defaults to query installed packages. To query packages from ebuild
trees, use the
-t option.
If there is no answer to your query (i.e. you've asked for a package
that is not installed, or a version that does not match), then you will
get empty output.
After version
0.74 of portag-utils,
qdepends was changed
considerably to be more consistent and more advanced. Most notably,
this has changed default output for reverse mode (
-Q). Instead of
just displaying the package name, like for forward mode, all
dependencies for the package are shown. When colours are enabled, the
matched atom is highlighted in the list. In addition to just querying
DEPEND, the default mode changed to query all DEPEN-variables, and
return the unique atoms found in them. Automatic regular expression
match support was removed. The
-N option was removed, as the same
effect can be achieved via the new
-F option or
-q option.
The
-f option was renamed to
-S.
OPTIONS
- -d, --depend
-
Show DEPEND info.
- -r, --rdepend
-
Show RDEPEND info.
- -p, --pdepend
-
Show PDEPEND info.
- -b, --bdepend
-
Show BDEPEND info.
- -I, --idepend
-
Show IDEPEND info.
- -Q, --query
-
Query reverse deps. This basically reverses the search to any
package that references <arg> in DEPEND, RDEPEND, PDEPEND or BDEPEND.
This can be useful to find consumers of a given package, e.g. to
search for packages that have logwatch in their DEPEND. Note
that using versions or range specifiers may yield odd results since
dependency strings often have ranges themselves. For installed
packages, SLOT and SUBSLOTs are available, thus SLOT and antiSLOT
queries are possible. See qatom(1).
- -i, --installed
-
Search installed packages using VDB.
- -t, --tree
-
Search available ebuilds in the tree.
- -U, --use
-
Apply profile US-flags to conditional deps.
- -F <arg>, --format <arg>
-
Prett-print DEPEND declaration to be used in an ebuild. This
option initiates a very different mode of operation. Instead of
printing searching through packages, it constructs a mult-line
statement with shell syntax, to be used in an ebuild. Each
argument is turned into a separate DEPEND variable declaration. You
need to quote dependency strings in order for them to be printed as
a single dependency declaration. When used with the -q
option, only the prett-printed dependency declaration is printed,
e.g. the DEPEND= part is skipped.
- -S, --pretty
-
Pretty format specified depend strings.
- -R, --resolve
-
Resolve found dependencies to package versions.
- --root <arg>
-
Set the ROOT env var.
- -v, --verbose
-
Prett-print atoms output, per DEPEN-variable. This is much like
the -f option, but uses as input the dependency info from the
matches. When used with -t, the atom highlighting matches
what is used by the installed package, if available.
- -q, --quiet
-
Suppress DEPEND= output for -f. Only print the matching atom for -Q. When given two or more times, suppresses the matching atom for -Q, e.g. producing just a list of packages.
- -C, --nocolor
-
Don't output color.
- --color
-
Force color in output.
- -h, --help
-
Print this help and exit.
- -V, --version
-
Print version and exit.
EXAMPLES
For finding out what a particular package depends on for building, you could do:
$ qdepends-d nano
ap-editors/nan-2.3.2: >=sy-libs/ncurse-5.-r1[unicode] sy-apps/file ...
This tells us that we have
ap-editors/nan-2.3.2 installed and it depends
on ncurses (among other things).
Searching for packages that actually depend on logrotate:
$ qdepends-qQ logrotate
sy-apps/portag-2.3.18: !<ap-admin/logrotat-3.8.0
The
-q flag suppresses the entire list of dependencies here, so we
can quickly see what specific dependency is expressed here. If
the above had used
<logrotat-3, for example, no matches would be
returned. Not using any specifiers allows to reveal in what way a
dependency is expressed.
Producing a list of packages that need rebuilding after a Perl upgrade:
$ qdepends-Qqq-F '%[CATEGORY]%[PN]%[SLOT]' ^perl:0/5.30
de-vcs/git:0
per-core/Fil-Temp:0
de-perl/Tex-CSV_XS:0
...
With the double
-q flag, just the matching packages are returned,
allowing to use the list for instance as arguments to
emerge(1).
The custom formatter in this case ensures all selected packages will be
the best matching for the currently installed SLOT. Finally, the use of
the antislot matching (
^) is returning all packages that depend on
perl in SLOT
0, but in a different SUBSLOT than
5.30,
effectively requesting the list of packages that need rebuilding to use
the newly installed version of Perl.
REPORTING BUGS
Please report bugs via
http://bugs.gentoo.org/
Product: Gentoo Linux; Component: Current packages
AUTHORS
Ned Ludd <solar@gentoo.org>
Mike Frysinger <vapier@gentoo.org>
Fabian Groffen <grobian@gentoo.org>
SEE ALSO
q(1),
qatom(1),
qcheck(1),
qfile(1),
qgrep(1),
qkeyword(1),
qlist(1),
qlop(1),
qmanifest(1),
qmerge(1),
qpkg(1),
qsearch(1),
qsize(1),
qtbz2(1),
qtegrity(1),
quse(1),
qwhich(1),
qxpak(1)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- EXAMPLES
-
- REPORTING BUGS
-
- AUTHORS
-
- SEE ALSO
-