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.
Clayton stanley
source share