upgrade outdated example

Ryan Schmidt ryandesign at macports.org
Sun Apr 6 16:18:25 PDT 2008


On Apr 6, 2008, at 05:50, Tom Allison wrote:

> sudo port -u upgrade outdated
> Password:
> --->  Activating apr 1.2.12_1
> Error: Activating apr 1.2.12_1 failed: Image error: Another version  
> of this port (apr @1.2.11_0) is already active.
>
> This is the kind up upgrade problems I run into.
> I manually deactivate/activate the packages?

Other ports probably depend on apr. Therefore, asking port to  
uninstall apr will fail. "port -u upgrade" means "port upgrade" and  
then "port uninstall" therefore you'll run into the error.

Since you're upgrading to a new version of apr, uninstalling the old  
one is fine. MacPorts just doesn't know that. So you have to tell it,  
by forcing the uninstall of the old version:

sudo port -f uninstall apr @1.2.11_0
sudo port activate apr @1.2.12_1


In the future, here's some pseudocode for a nice way to upgrade all  
your ports and uninstall the old versions:

while there exist an outdated port
do
	let foo be an outdated port
	sudo port upgrade foo
loop
sudo port -f uninstall inactive

Thanks to Emmanuel Hainry for this. See his suggestion here, and see  
the rest of the thread for other alternatives that don't work, and  
explanation of why this one does:

http://lists.macosforge.org/pipermail/macports-users/2007-October/ 
005844.html



More information about the macports-users mailing list