When trying to install SciTE

sudo port install scite

port stops at

Error: org.macports.activate for port gettext returned: Image error: /opt/local/bin/autopoint already exists and does not belong to a registered port. Unable to activate port gettext. Use 'port -f activate gettext' to force the activation.

but if I run sudo port -f activate gettext and re-try installing scite, I end up with the same error message, this time with /opt/local/lib/libffi.6.dylib and libffi and so on and so on...

How can I tell Macports to force activate all ports that stand in it's way from completing installing SciTE, without having to manually re-run the installation of the package I actually want and without having to copy-paste each activation command?

  • 1
    The obvious question is what happens if you back up your mac and then delete the problem file /opt/local/bin/autopoint ?
    – bmike
    Commented Apr 4, 2016 at 14:52
  • Jove you upgraded OSX since installing Macports or restore /opt from a backup?
    – mmmmmm
    Commented Apr 4, 2016 at 16:16
  • @bmike it's a different file each time, I made that clearer now.
    – qubodup
    Commented Apr 4, 2016 at 20:30
  • @Mark I can't remember how all that /opt/ content got there. I had brew installed previously. More likely though: perhaps by installing one or multiple packages exported from Macports that I wasn't aware of.
    – qubodup
    Commented Apr 4, 2016 at 20:31
  • Oh dear - you might need to declare /opt bankruptcy and wipe/uninstall. I'm more versed in homebrew so I can't advise you on specifics here.. Hopefully a ports user can point out how to uninstall or repair a broken setup like you're reporting.
    – bmike
    Commented Apr 4, 2016 at 20:33

2 Answers 2


I was able to install the desired port by automating the activation process. The app fails to run due to some library version issues and I seem to be unable to fix those but that's a story for another answer or another question.

  1. Create a script that continuously tries to install the port and automatically forcefully activates the discovered port that is blocking it. Copy paste the following into a file and call it port-instact.sh

    if [ "$EUID" -ne 0 ]
      then echo "Please run as root"
    while [ 1 ]
        echo trying to install "$target"
        if [[ $(port installed "$target" | grep "$target") ]]; then echo "$target" present; break; fi
        line=`port install "$target" 2>&1 > /dev/tty | grep "port -f activate"`
        package=$(echo $line | sed -e "s/^.*port -f activate //" -e "s/. .*//")
        if [ "$package" = "$oldpackage" ]; then echo double \""$package"\"; break; fi
        echo activating "$package"
        port -f activate "$package"
  2. Make the file executable via chmod +x port-instact.sh

  3. Run it as root sudo ./port-instact.sh scite and wait

  • Wow, surprised this isn't a regular option in MacPorts. Thanks!
    – sudo
    Commented Dec 30, 2016 at 3:59
  • would be even better if all the "Continue? [Y/n]: Y" can be piped to yes. Commented Jul 9, 2019 at 0:54

Deleting everything Macports and reinstalling it allows you to normally install ports.

Use the elaborate rm command from Macports guide (uninstalling):

sudo rm -rf \
        /opt/local \
        /Applications/DarwinPorts \
        /Applications/MacPorts \
        /Library/LaunchDaemons/org.macports.* \
        /Library/Receipts/DarwinPorts*.pkg \
        /Library/Receipts/MacPorts*.pkg \
        /Library/StartupItems/DarwinPortsStartup \
        /Library/Tcl/darwinports1.0 \
        /Library/Tcl/macports1.0 \

Thanks to Mark for the suggestion.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .