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 removesudo apt-cache depends lubuntu-desktop
Remove these dependenciessudo apt-cache depends lubuntu-desktop | awk 'NF && /Depends:/ {print "sudo apt-get -y remove "$2}' | sh
Clean up the related dependenciessudo apt-get autoremove