Is there any way to retrieve a dependency tree from yum?

Per the RHEL5 manual pages: “repoquery is a program for querying information from YUM repositories similarly to rpm queries.”

For your specific case of postgis:

# repoquery --requires --recursive --resolve  postgis
postgresql-libs-0:8.1.23-6.el5_8.i386
geos-0:2.2.3-3.el5.i386
glibc-0:2.5-107.el5_9.5.i686
proj-0:4.5.0-3.el5.i386

You can drop the “.i386” and “.i686” off of the package names if your system is 64-bit.

The output from repoquery is not perfect since, for example, it fails to list glibc-common in the above list. But your system would not be running if it did not have both glibc and glibc-common already installed.

EDIT: Although it does not cause an error, the --recursive flag appears to do nothing in RHEL5.11 and can be omitted. Also, use the --pkgnarrow=all flag to ensure that all (installed, available, etc) packages are considered for the query. Lastly, for one step of recursion to get more of the dependency tree, in a bash shell, pass the output of the repoquery command to a second repoquery command using tee and xargs like so:

# repoquery --requires  --resolve --pkgnarrow=all postgis.i386 | tee >(xargs -r -n 1 -- repoquery --requires  --resolve --pkgnarrow=all) | sort | uniq
basesystem-0:8.0-5.1.1.noarch
geos-0:2.2.3-3.el5.i386
glibc-0:2.5-123.el5_11.3.i686
glibc-common-0:2.5-123.el5_11.3.i386
krb5-libs-0:1.6.1-80.el5_11.i386
libgcc-0:4.1.2-55.el5.i386
libstdc++-0:4.1.2-55.el5.i386
openssl-0:0.9.8e-40.el5_11.i686
postgresql-libs-0:8.1.23-10.el5_10.i386
proj-0:4.5.0-3.el5.i386

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)