Removing Ubuntu software packages and no longer needed dependencies

On my Ubuntu Servers I use the apt-get command to install and remove packages from my Ubuntu servers.

So for example, this weekend I installed and started playing with Cacti (A front end for SNMP) however after installing it I found I had several issues with the software and wanted to revert the operating system back to its original settings (without the other 20+ dependencies that was installed originally eg. Apache, MySQL and various libs etc).

So (as I didn’t take a note of all the installed dependencies) I decided to take a look around the net for a solution to remove all automatically dependencies that were installed when I originally used:-

apt-get install cacti

So…. Here is the command that will not only remove the package but also any dependencies that where originally installed from the above command (that are no longer in use on the system)…. A really great way to clean up any unnessacery software on your Ubuntu server; well in my opinion anyway 🙂

So heres the command:-

apt-get autoremove cacti

which is used instead of the normal remove package command (apt-get remove cacti)

I hope you found this useful! – For more infomation regarding APT please see this webpage: https://help.ubuntu.com/community/AptGet/Howto

Share