Remove Unused Packages – CentOS/RHEL/Ubuntu

To clean up unused packages on a host:

CentOS/RHEL:


yum install yum-utils

package-cleanup --leaves --all

Ubuntu:


sudo apt-get autoclean && sudo apt-get autoremove