This command will remove packages that were installed as dependencies for another package that has been removed, and so are no longer needed.
sudo apt-get autoremove