Very often we install a package just for short usage.
Most of the time do these packages install a lot of dependencies along with it. After you don’t require the package anymore you remove it but the dependencies are not removed. Every unused package increases the security risk and it also needs some space.
A good example is an environment for compiling from sources.
$> yum groupremove “Development tools”
Remove 25 Packages (+2 Dependent packages)
And here is the solution:
There is a nice plugin called “yum-plugin-remove-with-leaves” which does what it says to do.
Now you can suffix a yum remove command with “–remove-leaves”, which will remove any unused dependencies along with the package.
If you want this behaviour by default you can modify “/etc/yum/pluginconf.d/remove-with-leaves.conf” and set “remove_always” to true:
Taking our example from above you see the difference:
All the 58 packages that were installed are going to be removed!