Our production server is running CentOS release 5.2 (Final).
How do I see/get/list all the dependencies of an already installed RPM package?
For example: SQLite v3.3.6 is already installed in the server. I want to see all the dependencies of this particular package.
Here is the output of the command: rpm -qa |grep sqlite
python-sqlite-1.1.7-1.2.1
sqlite-3.3.6-2
sqlite-3.3.6-2
Also, why it is listing 2 entries of sqlite-3.3.6-2
here?
The
yum deplist
command will show you which rpm's are dependencies, here's an example for theexpect
package (this will work even if you don't yet have the package installed locally):rpm -q --requires somepackagehere
One is the
i?86
package, the other is thex86_64
package.Following on Ignacio's answer, you can see the specific architecture of the packages by doing the following:
In my case, I only have the one, i686 package...but you can get the architecture associated with the packages that way. If you are interested in what else you can get from the --queryformat, issue a
rpm --querytags
to see the list of variables available.People have already responded with:
rpm -q --requires PKG
yum -q deplist PKG
Yes, either
rpm
oryum
works and correctly answers the question. The main difference betweenrpm
andyum
is that yum also shows what packages you can install to meet the library and/or file requirements. Unfortunately, if the package isn't installed, neither one of these methods are useful. Since the original poster already specified that the package you are checking is installed, this is a mute point.What if you didn't have the package installed?
yum
can still be used, but indirectly. You can do a mock install by canceling the install operation.Here is an example:
I have quick shell snippet which prints out all installed packages along with their dependencies: