I keep forgetting that -u does an uninstall of old macport versions

macports-logo-top.pngAccording to the MacPorts port command man page the option -u: “uninstall non-active ports when upgrading and uninstalling”.

Just running port upgrade all the time litters your systems with lots and lots op old archived versions of installed ports.

To correct this whole mess you could run “sudo port -u uninstall”. This should uinstall any archived versions you might have. You might need to add a -f to that to make it work: “sudo port -uf uninstall”.

You might have some trouble when you force a removal like this when one of your installed ports is linked against an older version of a library. This can be fixed by replaying some steps on this page.

Basically this post is a reminder for myself. But just maybe someone might find this useful too.