MacPorts “Error: Failed to locate” Solution

Two days ago, I tried to update some of the applications installed with MacPorts and got an error that looked like this:

Error: Failed to locate ‘openssl’ in path: ‘/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin’ or at its MacPorts configuration time location, did you move it? Please run `port -v selfupdate’ for details.

I spent a lot of time checking and trying to change several bash “dot files”; i.e. .bash_profile, .profile, and .bashrc to make sure that the path to an existing openssl version was visible to any application running on my system. I also spent time trying to fiddle with the macports.conf file in /opt/local/etc/, with no meaningful results.

None of my changes to my “dot files” had any effect on MacPorts ability to find, in this instance, an existing openssl version on my computer in order to proceed with its updating of installed ports.

I found that the folders MacPorts checks for applications in are not those in the other “dot files” mentioned above. All the “PATH” preferences in my “dot files” were being ignored.

Here is the section of the macports.conf file where the paths MacPorts was checking are listed:

# Colon-delimited list of directories to search for external tools
# (make(1), pkg-config(1), etc.). While installing ports, MacPorts uses
# this list for PATH. Changing this setting is intended for advanced
# users only and is unsupported.
#binpath /opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

Finally, after a day and a night of trying, I decided to create a symbolic link from an existing openssl instance on my computer to a folder where MacPorts looks for applications. I did that by executing the following from the terminal:

sudo ln -s /usr/local/bin/openssl /opt/local/bin/openssl

This worked, partially. MacPorts downloaded and installed openssl BUT failed to activate the latest version of openssl it had just downloaded because of the presence of the symbolic link I created!

So, I ran the following command to rename the openssl symbolic link I created to “openssl.old”:

sudo mv /opt/local/bin/openssl /opt/local/bin/openssl.old

Next, I ran the following command:

sudo port -f activate openssl

The application was activated and I was able to proceed with all the other updates and upgrades, etc. that I had intended to perform two days ago.

I decided to write this up in case someone else struggled with this type of problem. I saw many examples of this type of issue on StackExchange and other online forums.

Bookmark the permalink. Follow any comments here with the RSS feed for this post. Both comments and trackbacks are currently closed.
  • What's Up?

    We're closed!
    But the blog posts keep on comin'