deborphan command finds packages that have no packages depending on them. The default operation is to search only within the libs and oldlibs sections to hunt down unused libraries.
1 | $ deborphan -sz |
Where,
- -s: Show the sections the packages are in.
- -z: Show the installed size of the packages found.
You can remove orphaned package with apt-get remove command:
1 | # apt-get remove packagename |
Alternatively, remove all orphaned package in one command:
1 | # apt-get remove $(deborphan) |
Better try:
1 | # apt-get remove --purge $(deborphan) |