Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

To reduce the chance of the XY problem, I'm trying to install PostGIS on a clean, virtual RHEL5 installation with heavy restrictions. I do not know if we (as a company) have a RH subscription.

# yum install postgis Loaded plugins: product-id, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Setting up Install Process No package postgis available. Nothing to do. 

It throws the same error when I try to install emacs, so I'm relatively certain that it doesn't matter which package I'm trying to install.

The VM has internet access.

All I want to do is retrieve a complete dependency graph for a piece of software I specify (obviously, i.e. postgis). yum must already compute this dependency graph (or have one available for retrieval) to do its job, so how can I tap into this resource?

like image 220
Sean Allred Avatar asked May 30 '13 19:05

Sean Allred


People also ask

How do I get the list of dependencies for a package using yum command?

The command # yum deplist [package-name] will list all dependencies.

How do I find the dependencies of an RPM?

It is a powerful command line package management system for installing uninstalling, verifying, querying, and updating Linux computer software packages. However RPM has in build mechanism to tell you about dependencies. Just try to install package and it will give you list of dependencies.


1 Answers

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 
like image 86
ZaSter Avatar answered Sep 18 '22 17:09

ZaSter