Unable to install program to usr/local/bin folder

I am trying to install an application which is trying to create a folder under usr/local/bin but fails and says the bin directory does not exist. When I check for the bin directory it only has an executable file under usr/local called bin. How do I access the usr/local/bin directory or allow the application to create a new folder under usr/local/bin to install to?

MacBook Pro (2020 and later)

Posted on Jan 14, 2022 7:21 AM

Reply
10 replies

Jan 14, 2022 7:40 AM in response to jg2111

Remove that executable named bin in your /usr/local path. You need to create that bin directory under /usr/local:


sudo mkdir -p /usr/local/bin


Enter your admin password at the prompt. It will not echo to the Terminal window. Once you create that bin directory, then you need to make it your own:


sudo chown -R $(id -nu):admin /user/local/bin



This is how mine is configured and I can add items to /usr/local/bin afterward without the use of sudo.

Jan 14, 2022 7:54 AM in response to jg2111

In the Terminal:


file /usr/local/bin
"/usr/local/bin: directory"



If you get any other result than a directory, then do as I mentioned and remove the bin file, before applying that mkdir -p syntax as I previously stated. Unless you do that, mkdir -p will fail as it cannot overwrite a bin file with a directory of the same name.


This is how I set up my homebrew on an Intel Mac. On M1 Macs, homebrew wants /opt/homebrew/bin because it will build native arm64 package binaries there. That also requires an adjustment to your PATH environment variable too.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Unable to install program to usr/local/bin folder

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.