Not that I used this recently, but saw an article on some commands that thought would be good to document here:

(after a bad install or upgrade of packages that effect the core OS)

dpkg --configure -a
apt clean
apt autoremove