Normally, removing a package using the YUM package management system will remove that package together with its dependencies. However, certain dependencies will not be removed on the system, these are what we can term as “unused dependencies” or (so-called “leaf packages” according to YUM man page).


1. Using YUM’s Autoremove Option


This method requires you to add the directive clean_requirements_on_remove in YUM’s main configuration file /etc/yum.conf. You can use your favourite command line editor to open it for editing as shown.

# vim /etc/yum.conf


Then add the following line to the /etc/yum.conf file as shown in the output below. A value of one indicates that the directive is enabled (or turned on), a zero means otherwise.




Save the changes and exit the file.


From now, every time you remove a packages, YUM goes through each package’s dependencies and remove them if they are no longer needed by any other package.

# yum autoremove


2: Using yum-plugin-remove-with-leaves Plugin


This extension removes any unused dependencies that were added in by an installation package, but would not be removed automatically. It also helps you to keep a system clean of unused libraries and packages.


First install this extension on your system using following yum command.

# yum install yum-plugin-remove-with-leaves


Once you have installed the extension, each time you want to remove a package, add the --remove-leaves flag, for example.

# yum remove policycoreutils-gui --remove-leaves


For more information, check out YUM’s man page:

# man yum


?האם התשובה שקיבלתם הייתה מועילה 2 משתמשים שמצאו מאמר זה מועיל (72 הצבעות)