Clean up orphaned software
Warning: !! PROCEED AT YOUR OWN RISK !!
Proceed At Your Own Risk
This sections cover things that are high risk because there is a possibility they can make your system unusable, or are considered unnecessary by many because the risks outweigh any rewards.
Why clean up Orphaned Software?
As you use your system, and you install and uninstall software, you’ll eventually end up with orphaned, or unused software/packages/libraries. You don’t need to remove them, but if you don’t need them, why keep them? When security is a priority, anything not explicitly needed is a potential security threat. You want to keep your server as trimmed and lean as possible.
- Each distribution manages software/packages/libraries differently so how you find and remove orphaned packages will be different. So far I only have steps for Debian based systems.
Debian Based Systems
On Debian based systems, you can use deborphan to find orphaned packages.
What’s the risk?
Keep in mind, deborphan finds packages that have no package dependencies. That does not mean they are not used. You could very well have a package you use every day that has no dependencies that you wouldn’t want to remove. And, if deborphan gets anything wrong, then removing critical packages may break your system.
Steps - Clean up Orphaned Software
sudo apt install deborphan
Run deborphan as root to see a list of orphaned packages:
Assuming you want to remove all of the packages deborphan finds, you can pass it’s output to
aptto remove them:
sudo apt --autoremove purge $(deborphan)