https://access.redhat.com/sites/default/files/attachments/rh_yum_cheatsheet_1214_jcs_print-1.pdf
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