Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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
1  
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.

Example:

$ 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.