Removing an application and its dependencies on CentOS/RHEL

By default yum remove only removes the package you specify. To also remove everything that got installed along with it, use the yum-plugin-remove-with-leaves package.

Install it:

yum install yum-plugin-remove-with-leaves

Now you can nuke an app along with its leftovers using the -remove-leaves flag:

yum remove package_name -remove-leaves

To make yum always drop package dependencies on removal, edit /etc/yum/pluginconf.d/remove-with-leaves.conf and add this line:

remove_always = 1