pkg_rmleaves − deinstall ’leaf’ packages


pkg_rmleaves [-l]


pkg_rmleaves finds packages that are not required (depended on) by any other installed package and lets you decide (in a beautiful BSD dialog interface) for each one if you want to keep it or delete it.

Once the packages marked for removal have been deinstalled, you’ll be asked if you want to do another run to see packages that have become ’leaves’ now because you’ve deinstalled the package(s) that depended on them. In every run you will be shown only packages that you haven’t decided to keep yet in a previous run.

This version automatically detects if you are using the new pkg(8) package management system (also known as pkgng) or still the old pkg_* tools. It works with both package management systems, but may show more information with the new pkg(8) system.



List leaf packages only, one per line, and don’t ask for anything to be deinstalled.


Timothy Redaelli <drizzt (at)>
Alexander Wittig <alexander (at)>


bsddialog(1), pkg(8), pkg_delete(1), pkg_info(1)


pkg_rmleaves is available directly in the FreeBSD ports tree at ports-mgmt/pkg_rmleaves. You can install it either as a package or directly from ports. The latest version of the tool is also available directly here: pkg_rmleaves-latest.tar.gz.