0

I purchased a new mac and want to install some tools on it but when I try to install anything, I am getting error as bin is not a folder . I am on 11.1 and have not updated it to 11.4 yet.

Well why /bin inside my path /usr/local/ is a file not folder, isn't it supposed to be a folder???

I tried moving current /bin which is as a file to another location and created a folder as /bin inside /usr/local/ path.

But this made my mac not working properly, so I had to reinstall Macos.

I am very confused over this and because of this problem I am unable to install anything in my mac, someone please help.

$ ls -dl /usr/local/bin
-rwxr-xr-x@ 1 username  wheel  xxxxxxxx Sep 26 06:36 /usr/local/bin

Here is the output for " ls -ledO /usr/local/bin /usr/local "

drwxr-xr-x  16 root  wheel  sunlnk      512 Dec 27 20:57 /usr/local
-rwxr-xr-x@  1 bala  wheel  -      82560592 Sep 26 06:36 /usr/local/bin

my bin is showing as exec file like this

enter image description here

6
  • What happens if you do cd /usr/local; sudo mv bin bin.file; sudo mkdir bin? – nohillside Jan 4 at 7:44
  • creating bin as a folder manually has created many problem with me before, my sudo comand is not working after that and my mac also behaved very weirdly after that change and has to reinstall to resolve that – Bala krishna Jan 4 at 7:49
  • You seem to have Homebrew installed, so I assume you migrated your Mac from an earlier version of macOS? WIthout more details about what exactly you did and what exactly the result was (and maybe further analysis on that), it might be easier to backup your system with Time Machine, make a clean install of Big Sur, recover only your applications and your user data and then reinstall Homebrew from scratch. – nohillside Jan 4 at 8:13
  • 4
    My guess is the original problem came from trying to install a new binary (either manually or in an installer script) with something like mv newbinaryprogram /usr/local/bin. If /usr/local/bin already exists as a directory, this installs the program into it, but if it doesn't already exist it moves the program into /usr/local and renames it "bin"... giving the result you saw. Always make sure /usr/local/bin exists before trying to install anything into it. – Gordon Davisson Jan 4 at 9:54
  • 2
    Why in the output of ls -dl /usr/local/bin did you modify the reported size with "xxxxxxxx"? It makes no sense whatsoever to obfuscate the size in the output of that command! – user3439894 Jan 4 at 15:40
6

This is definitively not how it should be, but without a lot of additional analysis it's impossible to figure out what else is wrong. So to be on the safe said, I would

  • create two good, verified backups
  • do a clean install (not an upgrade)
  • restore Applications and user directories from Time Machine
  • install Homebrew from scratch.
0

You must log in to answer this question.

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