MacOS – macports is not uninstalling a package


Earlier today, I tried using MacPorts to install gnutar. By doing the following

sudo port install gnutar

But now I've decided I didn't want to do this. So I tried to uninstall by doing

sudo port uninstall gnutar

but the binaries are still in place and functioning.

Why wasn't it uninstalled?

Best Answer

Most likely you have another port installed that depends on gnutar, so the uninstall command didn't remove it. Run

port dependents gnutar

to see if this is the case (sudo is not required for some port actions like list, installed, dependents, etc.). If you want to uninstall everyone,

sudo port uninstall --follow-dependents gnutar

will do the trick, but obviously could lead to unintended consequences, as all the dependents of all the dependents will be uninstalled, recursively, and you could end up decimating your port collection. Only do this if you know exactly what you're doing. gnutar is fairly small and unobtrusive, so if you can't easily get rid of it you won't be that bad off in terms of disk space.