How to clean up after removing a package via apt-get

  • Post by Mike Dixson
  • Aug 14, 2014

Say you install a package via apt-get like lubuntu-desktop. There’s a ton of dependencies and apps that get installed because of one simple meta-package install.
If you remove lubuntu-desktop only a small amount of that gets removed. I wanted to dejunk a server and so used the following commands to check what else was installed and to remove them all.

Look at the dependencies to make sure those are what you want to remove
sudo apt-cache depends lubuntu-desktop
Remove these dependencies
sudo apt-cache depends lubuntu-desktop | awk 'NF && /Depends:/ {print "sudo apt-get -y remove "$2}' | sh
Clean up the related dependencies
sudo apt-get autoremove

  • Post By Mike Dixson
  • Nov 17, 2020
Using MFA for Sudo Only
  • Post By Mike Dixson
  • Jul 25, 2020
Fixed: Obelisk not working in Ableton Live
  • Post By Mike Dixson
  • Jun 15, 2020
BYOBU files being flagged by rkhunter