When maintaining macports packages, I prefer to remove old packages when I replace them with new ones. However, over time as packages are upgraded, you end up with problems like:

$ sudo port uninstall -f postgresql83
--->  The following versions of postgresql83 are currently installed:
--->    postgresql83 @8.3.3_0
--->    postgresql83 @8.3.7_0
--->    postgresql83 @8.3.8_1 (active)
Error: port uninstall failed: Registry error: Please specify the full version as recorded in the port registry.

Is there a macports command to remove all versions of a package at once?

link|improve this question
feedback

2 Answers

up vote 10 down vote accepted

If you want to uninstall all the old (non-active) versions try this:

port -y -u uninstall
  # if you like what you see, change “port -y” to “sudo port”

If you mean that you want to uninstall all the versions (non-active and active) of (e.g.) the postgresql83 port, then try this:

port -y uninstall installed and postgresql83
  # if you like what you see, change “port -y” to “sudo port”
link|improve this answer
That worked for me, too bad port doesn't handle dependency updates to postgres84 automatically though. – Dana the Sane Dec 8 '09 at 14:09
@Dana the Sane If you mean removing packages that depend on postgres84 automatically, you can use the --follow-dependents argument. – Nick Dec 13 '11 at 5:26
@Nick I'll try that next time I uninstall something. – Dana the Sane Dec 13 '11 at 5:54
feedback
sudo port uninstall inactive

This will remove your inactive ports.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.