homebrewosx-yosemite

Can't install Homebrew on Yosemite: /usr/local/lib already exists


I tried installing Homebrew on Yosemite for the first time. I chose to install via Terminal, though I am no expert on it. And then this happened:

-e:161: warning: Insecure world writable dir /usr/local in PATH, mode 040777
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/lib

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/lib
Password:

Then I entered my password. Then this happened:

mkdir: /usr/local/lib: Not a directory
Failed during: /usr/bin/sudo /bin/mkdir -p /usr/local/lib

And when I checked my /usr/local/ directory there was already a file named lib.

This is a screen-capture of my /usr/local/ directory.

I can't seem to install Homebrew with this. Can anyone please advise me on my next step? Thanks a lot in advance.


Solution

  • Well you need to, at least temporarily, rename /usr/local/lib because it doesn't belong to homebrew and is in the way:

    sudo mv /usr/local/lib /usr/local/oldlib