Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My Mac accumulated a lot of installed ports that I may not need when reinstalling it soon.

I want to only install those packages which I know I'm using, but to filter them out of the huge list of port list installed is impractical.

I'm looking for a way to out put a list of just those installed packages which don't have any other package depending on them. Better yet, I'd love to have a way to visualize the dependencies.

Any ideas on how to accomplish either one?

share|improve this question
up vote 2 down vote accepted

EDIT: I was wrong last time. I think now the correct command you could use is port list requested. You can also set and unset requested status with port setrequested and port unsetrequested, respectively.

share|improve this answer
Note this only works correctly if you are using 1.9 or newer with the sqlite registry format. If you had an older installation, you need to change your portdbformat in macports.conf first and manually mark software you want as requested. With the new registry format dependencies will always be considered unrequested. – Raim Sep 5 '10 at 23:44

You can use the script port_cutleaves to find installed ports which you no longer need. It interactively walks through the leaves of the dependency tree and allows to trigger the actions keep or uninstall. It also provides a man page describing more advanced options.


$ sudo port install port_cutleaves
$ sudo port_cutleaves
[Leaf 1 of 13] samba3 @3.2.15_1 (active):
  [keep] / (u)ninstall / (f)lush / (a)bort:
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .