Clean way to uninstall outdated inactive ports

Ross Walker rswwalker at hotmail.com
Tue Jul 22 16:34:44 PDT 2008


Is there a clean way to uninstall outdated inactive ports other then 'port
-f uninstall inactive'?

I tried passing the -u flag to 'port -u upgrade outdated', but if the port
has dependencies (and a lot do) then it will fail both the upgrade of the
new version and the old.

For example:

rivendell:~ root# port -u upgrade outdated
--->  Fetching glib2
--->  Attempting to fetch glib-2.16.5.tar.bz2 from
ftp://ftp.gtk.org/pub/glib/2.16/
--->  Attempting to fetch glib-2.16.5.tar.bz2 from
http://mandril.creatis.insa-lyon.fr/linux/gnome.org/sources/glib/2.16/
--->  Verifying checksum(s) for glib2
--->  Extracting glib2
--->  Applying patches to glib2
--->  Configuring glib2
--->  Building glib2 with target all
--->  Staging glib2 into destroot
--->  Unable to uninstall glib2 2.16.4_1+darwin_9, the following ports
depend on it:
--->      atk
--->      pango
--->      shared-mime-info
--->      gtk2
--->      libidl
--->      orbit2
--->      gconf
--->      gnome-keyring
--->      dbus-glib
--->      desktop-file-utils
--->      libbonobo
--->      gail
--->      libgnomecanvas
--->      libbonoboui
--->      libcroco
--->      py25-gobject
--->      xsane
--->      wireshark
--->      pango
--->      shared-mime-info
--->      pango
--->      wireshark
--->      gnome-keyring
--->      wireshark
Error: Uninstall glib2 2.16.4_1+darwin_9 failed: Please uninstall the ports
that depend on glib2 first.

Maybe I should have passed the -f flag too?

After that I just did a straight 'port upgrade outdated' followed by a 'port
-f uninstall inactive', because port didn't install and activate the new
version before it (unsuccessfully) tried to uninstall the old version :-(.

It would be nice if 'port' had a way to cleanly uninstall an inactive port
without having to force it as well as to make sure a port was successfully
installed and activated before it tried to deactivate and uninstall the old
version.

It would be even nicer if port only kept the last X versions of a port, X
being a configurable option, so a user can have the previous version
available in case the new version is broken, but wouldn't have to worry
about cleaning out the other 5 or 6 older versions also hanging around.


-Ross




More information about the macports-users mailing list