Is there a command to find out such information on a CentOS machine?
3 Answers
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.

- 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
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.

- 339
- 4
- 11
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.

- 10,263
- 1
- 20
- 27