An innocent port upgrade -uc outdated
turned into macports breakage after it tried to deactivate gettext. The error messages, ad infinitum, are:
---> Deactivating gettext @0.17_3 Error: Deactivating gettext 0.17_3 failed: Error: Unable to upgrade port: dyld: Library not loaded: /opt/local/lib/libintl.8.dylib Referenced from: /opt/local/bin/ln Reason: image not found Error: Unable to exec port: dyld: Library not loaded: /opt/local/lib/libintl.8.dylib Referenced from: /opt/local/bin/ln Reason: image not found
The reason is that I have the coreutils+with_default_names port installed, and those binaries link to the gettext libraries. The coreutils binaries are used by the macports activation scripts, and the macports coreutils are earlier on the PATH. Cue breakage.
The solution, as explained on macports-users, is:
- Add a binpath to macports.conf that has the (presumably working) Apple coreutils in /usr/bin and /bin before the macports ones
port deactivate coreutils
port deactivate gettext
port activate gettext
port activate coreutils