
Over time you are bound to have ports installed that you no longer need. These may be things that you installed and no longer use, or ports that were depended on by another and remain after you have removed the parent port. No matter how they get there, after some length of time you are bound to have ports installed that you no longer need. A quick and easy way to identify ports that are not depended upon by other ports is to use pkg-orphan.
pkg-orphan can be found in your ports tree under sysutils/pkg-orphan. Once you install it, just run it as the super-user with the command:
You'll then be prompted, one by one, to make a decision on each orphaned port (one without anything depending on it). The choices are Delete, Keep, and Ignore. They tell pkg-orphan to delete the package, not to delete the package and remember this choice, and to not take any action on this port at this time. After you make a choice on each package, the script will go through and take the chosen action on each port. Once finished, you will see output along the lines of:
I like pkg-orphan over something like pkg_cutleaves because I don't have to pass any additional arguments for a keep file to be created. pkg-orphan creates a keep file automatically based upon the Keep choices I make. pkg-orphan also includes arguments for maintaining the keep file, though it is also just a text file you can edit (located by default at /var/db/pkg/orphans.lst).
Aug 4, 11:32 am
the freebsd port system saves a lot of time.