[CentOS] Trying to find packages that depend on package X.

Fri May 26 17:06:16 UTC 2006
Rodrigo Barbosa <rodrigob at suespammers.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, May 26, 2006 at 01:57:42PM -0300, Rodrigo Barbosa wrote:
> On Fri, May 26, 2006 at 12:35:40PM -0400, William L. Maltby wrote:
> > Quick search in bout "man yum" and "man rpm" shows how to find what
> > package X depends upon, but not what depends upon package X. Of course,
> > we could get a deplist for everything but I'm *guessing* that take more
> > overhead and grep too.
> > 
> > "yum remove" tells us. Then we just have to remember to say "No, don't
> > remove". Am I missing something... like I missed that big Google box on
> > the archives?
> > 
> > Anyway, if I haven't overlooked something, I was thinking that this
> > might be a good enhancement request for yum's buglist. Do like remove
> > but skip making us reliably answer "no".
> > 
> > OK. Did I miss something? Is this a feature that others would find
> > handy? Should I get it on a yum bug list?
> 
> Just needs a little magic:
> 
> rpm -q --provides PACKAGE_NAME | sed 's/^/"/;s/\([^[:space:]]\) *$/\1"/' | xargs rpm -q --whatrequires | grep -v -E '^no package'
> 
> ex:
> rpm -q --provides exim | sed 's/^/"/;s/\([^[:space:]]\) *$/\1"/' | xargs rpm -q --whatrequires | grep -v -E '^no package'

Small correction/improvement:

rpm -q --provides PACKAGE_NAME | sed 's/^/"/;s/\([^[:space:]]\) *$/\1"/;/=/{h;s/ =.*$/"/;G}' | xargs rpm -q --whatrequires | grep -v -E '^no package'

- -- 
Rodrigo Barbosa <rodrigob at suespammers.org>
"Quid quid Latine dictum sit, altum viditur"
"Be excellent to each other ..." - Bill & Ted (Wyld Stallyns)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEdzWIpdyWzQ5b5ckRAryeAJ9mS9bV4uLKn6bVjN5WgO/3Yl0O0wCfV0zu
0sSLxr6wzHAXMal4u0tXbW0=
=svfJ
-----END PGP SIGNATURE-----