how to delete deactivated ports

Ryan Schmidt ryandesign at macports.org
Thu Mar 20 00:08:44 PDT 2008


On Mar 20, 2008, at 00:04, J P Lewis wrote:

> (a novice question)
>
> I installed a package (py25-matplotlib), had some trouble with  
> using it,
> then did a port selfupdate,
>
> then upgraded the package.   In the process, a number of packages  
> were deactivated.
>
> For example, it looks like I now have two copies of python25, numpy,
> 3 copies of libpng, etc.
>
> How can I uninstall these now (to clean up and save disk space)?
>
> For example
>     port uninstall python25 @2.5.1_2+darwin_8
> says that I cannot uninstall this (deactivated) python because  
> other things
> depend on it.
>
> Most of those things are things that I'm actively using (py- 
> readline for example).
>
> should I uninstall and reinstall all of these?   If so, it seems  
> like upgrading is a bad
> strategy, one can save work by uninstalling and reinstalling?

Welcome to MacPorts!

The message you're referring to is misleading. It says that this  
specific version of the port cannot be uninstalled because other  
ports depend on it. In fact, MacPorts has no concept of depending on  
a specific version of a port, so the message should just say that  
other ports depend on that port. And since you already have a newer  
version of that port installed, there is no problem with uninstalling  
the older version. MacPorts is just being overly cautious. You can  
force the uninstallation as Paul said:

sudo port -f uninstall python25

If you already know when you upgrade that you want to uninstall the  
older version, you can use the -u flag:

sudo port -u upgrade python25

This will fail if any other ports depend on python25, with the same  
error message as discussed above. So you need to force it. But  
forcing the upgrade of e.g. python25 also forces the upgrade of all  
ports that python25 depends on, possibly multiple times. This is not  
what you want. So if you're going to force an upgrade, always use the  
-n flag with the -f flag to indicate that you do not want the  
recursive port upgrade feature:

sudo port -nfu upgrade python25

Yes, this whole situation is a little less than ideal, but it's what  
we have right now.



More information about the macports-users mailing list