1

Is there a command to find out such information on a CentOS machine?

tshepang
  • 377
  • 2
  • 12
karthick
  • 683
  • 3
  • 7
  • 14

3 Answers3

4

You could try

repoquery --whatrequires --installed python

--installed Restrict query ONLY to installed pkgs - disables all repos and only acts on rpmdb

--whatrequires CAPABILITY Query all packages that require CAPABILITY.

user9517
  • 115,471
  • 20
  • 215
  • 297
  • Note that the `--installed` option is available in CentOS6, but is not available in CentOS5. Bottom line for CentOS and RHEL, hundreds of packages require python. – ZaSter Mar 01 '13 at 21:41
  • Note that the results of this repoquery command are not recursive and therefore only lists the packages that are directly dependent on python. – ZaSter Mar 01 '13 at 21:56
3

The following command can be run by a non-root user to determine which packages require python.

rpm -q --whatrequires python

Another advantage of using the rpm command is that it only knows about packages that are installed on the local machine whereas "repoquery is a program for querying information from YUM repositories" and requires root access.

ZaSter
  • 339
  • 4
  • 11
1

If you type

yum erase python*

the yum process will list all software which is dependent (removing for dependencies) on the presence of the python packages.

Obviously, just answer no to whether you actually want to remove them.

NickW
  • 10,263
  • 1
  • 20
  • 27