Whenever I install a program via MacPorts, it gets and installs lots of dependencies. When I uninstall said program, how do I make MacPorts recursively remove all unused dependencies with it?
|
MacPorts 1.9.0 added the One of the features of the new format is that it keeps track of “requested” versus “unrequested” port installations. An unrequested port is one that was only installed because some other port depends on it. The You should examine your existing leaves before uninstalling any of them.
Some common leaves ( You can uninstall any remaining leaves quite easily:
Note: Before pruning your leaves, you may also want to uninstall old versions of ports that are no longer “active”. This may reveal a few more leaves (i.e. ports that are dependencies of ports that are installed, but inactive):
There are several sections in the MacPorts Guide that also describe the process of using |
|||||||||
|
Note the major caveat in the last paragraph. Dependencies are exactly that—dependencies—and different apps can (will) require the same dependencies. |
|||||||||||
|
|
The command to remove a port and its dependents is:
However, if the port you are uninstalling has dependents it will not uninstall without the Of course you should start by reading over the MacPorts Guide specifically looking into the Uninstall guide section. |
|||
|
|
|
I think the other answers, and the If you use fink, the debfoster package is designed to clean out your system and remove unused dependencies.
While Perhaps no solution currently exists for MacPorts. |
|||||||||||
|
|
I have written some scripts to automate port cleanup: https://github.com/vasi/macports-tools The 'macportsfoster' script will output a list of all ports not required by anything in the requested-list, ordered such that 'port deactivate $(macportsfoster)' will remove all of them in one shot. |
||||
|
|
|
There's also a script in MacPorts' contrib directory called port_cutleaves you can run to remove unneeded dependencies: http://trac.macports.org/browser/contrib/. It'll ask you for each to-be-uninstalled port and allows keeping some, should you want to. |
|||
|
|
