In MacPorts, how to identify and remove unused library ports?

Many ports in macports are installed as library dependencies on other (application) ports, but removing these application ports does not remove the corresponding library dependencies. Over time, many of these libraries become orphon, and it's just a waste of space. So I wonder if there is a way to find them.

Thanks.

+7
source share
3 answers

There is a / script package that you need to call port_cutleaves. I think it is available directly from macports or fink. In any case, your problem is with orphan dependencies, and this should remove them, it is a pity that I do not have usage data, since I did not go into the settings of my macports.

Update: this link can help you, this is a cheat sheet. http://www.jbmurphy.com/2011/02/17/my-mac-ports-cheat-sheet/

+3
source

To remove an inactive port, you can run

sudo port uninstall inactive

To remove from version 2.4 and higher, you can run

sudo port reclaim

The reclaim action attempts to free up space by deleting inactive ports and deleting unnecessary files that were downloaded during installation.

+3
source

As new versions of ports are installed, old versions are replaced with an inactive state, but remain on disk. To see these ports:

port list inactive

To remove all inactive ports:

[[ -z "$(port -q list inactive)" ]] || sudo port uninstall inactive

This does not remove active versions of any port, including ports that are only necessary when building a specific port. As @Mitchell Currie mentioned, use port_cutleaves if you want to remove these active ports.

+2
source

All Articles