Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

macos

macports

Lots of ports in macports are installed as library dependencies of the other (application) ports, but uninstall those application ports doesn't uninstall corresponding library dependencies. As time goes by, lots of such library ports become orphon and is just a waste of space. So I wonder if there is a way to find them out.

Thanks.

like image 614
Kan Li Avatar asked Aug 09 '11 06:08

Kan Li


2 Answers

To remove inactive port you can run

sudo port uninstall inactive

To remove from version 2.4 and upper you can run

sudo port reclaim

The reclaim action attempts to reclaim space by uninstalling inactive ports, and removing unnecessary files that were downloaded during the installation process.

like image 159
Krzysztof Safjanowski Avatar answered Nov 17 '22 19:11

Krzysztof Safjanowski


There is a package/script you need called port_cutleaves. I think it's available directly from macports or fink. Either way your problem is orphaned dependencies, and this should remove them, sorry I don't have details of usage as I'm away from my macports install.

Update: This link might help you, it's a cheat sheet. http://www.jbmurphy.com/2011/02/17/my-mac-ports-cheat-sheet/

like image 30
Mitchell Currie Avatar answered Nov 17 '22 18:11

Mitchell Currie