Homebrew for Mac OS X

I've read several glowing reviews of Homebrew recently, so I checked it out. It does some things the right way, for example putting everything you install in its own directory and then symlinking to /usr/local. You don't need sudo to install things after installing Homebrew itself (but you DO need to be an admin account), so that's a good thing too. But..

Let's take it for a spin. First problem: I don't run as an admin account, so I had to install Homebrew from an account that does have admin ability.


$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 3545, done.
remote: Compressing objects: 100% (3395/3395), done.
remote: Total 3545 (delta 35), reused 1498 (delta 19), pack-reused 0
Receiving objects: 100% (3545/3545), 2.68 MiB | 0 bytes/s, done.
Resolving deltas: 100% (35/35), done.
From https://github.com/Homebrew/homebrew
 * [new branch]      master     -> origin/master
Checking out files: 100% (3548/3548), done.
HEAD is now at f303993 Restore "mono 4.0.1"
==> Installation successful!
==> Next steps
Run `brew help` to get started
 

Well, that was easy. Now let's go get something else. I switched back to my normal, non-admin account.

$ brew install pdf2image
Error: Cannot write to /usr/local/Cellar
 

Oops. That's not going to work. The perms on the Homebrew stuff are all for the admin user. So I removed brew using a script I found in their FAQ. I then temporarily gave my normal account admin ability, rebooted, and reinstalled as myself. Sigh.. that ran into dozens of errors:

==> Downloading and installing Homebrew...
remote: Counting objects: 3555, done.
remote: Compressing objects: 100% (3404/3404), done.
remote: Total 3555 (delta 35), reused 1491 (delta 19), pack-reused 0
Receiving objects: 100% (3555/3555), 2.69 MiB | 3.21 MiB/s, done.
Resolving deltas: 100% (35/35), done.
From https://github.com/Homebrew/homebrew
 * [new branch]      master     -> origin/master
error: unable to unlink old 'Library/ENV/3.2.6' (Permission denied)
error: unable to unlink old 'Library/ENV/4.2' (Permission denied)
error: unable to unlink old 'Library/ENV/4.3/ant' (Permission denied)
error: unable to unlink old 'Library/ENV/4.3/apr-1-config' (Permission denied)
error: unable to unlink old 'Library/ENV/4.3/bsdmake' (Permission denied)
error: unable to unlink old 'Library/ENV/4.3/c++' (Permission denied)
error: unable to unlink old 'Library/ENV/pkgconfig/10.8/libxml-2.0.pc' (Permission denied)
error: unable to unlink old 'Library/ENV/pkgconfig/10.8/libxslt.pc' (Permission denied)
error: unable to unlink old 'Library/ENV/pkgconfig/10.8/sqlite3.pc' (Permission denied)

.. more of the same 

error: unable to unlink old 'Library/ENV/scm/git' (Permission denied)
error: unable to unlink old 'Library/ENV/scm/svn' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Acceptable-Formulae.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Bottles.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Brew-Test-Bot-For-Core-Contributors.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Brew-Test-Bot.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/C++-Standard-Libraries.md' (Permission denied)

.. more of the same 

error: unable to unlink old 'share/doc/homebrew/Common-Issues-for-Core-Contributors.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Common-Issues.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/Custom-GCC-and-cross-compilers.md' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-passed-pr.png' (Permission denied)
error: unable to unlink old 'share/doc/homebrew/brew-test-bot-triggered-pr.png' (Permission denied)
Checking out files: 100% (3557/3557), done.
fatal: Could not reset index file to revision 'origin/master'.
Failed during: git reset --hard origin/master
 

Obviously the removal process didn't work very well. That's unfortunately all too common. People tend to neglect removal needs as they change their main code.

Still, some things looked better:

$ brew install pdf2image
Error: No available formula for pdf2image 
Searching formulae...
Searching taps...
homebrew/x11/pdf2image
 

Whatever that means.. meaningless messages are also far too common. But at least it seemed to be trying.

Let's try something else:

$ brew install a2ps
Error: Could not create /usr/local/Cellar
Check you have permission to write to /usr/local
 

OK, let's make that directory by hand using my admin account, change its perms and try again.

$ brew install a2ps
Error: Permission denied - /Library/Caches/Homebrew/Formula
$ ls -ld  /Library/Caches/Homebrew
drwxrwxr-x+ 2 root  admin  68 May  5 08:49 /Library/Caches/Homebrew
 

Ahh, so this isn't going to work. It sets stuff up in the admin group. I suppose I could try ACL's, but at this point I just don't care enought to fool with it any more. If I want to install something from Homebrew, I'll just have to switch to the admin account.

apl$ brew install a2ps
==> Downloading https://homebrew.bintray.com/bottles/a2ps-4.14.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring a2ps-4.14.yosemite.bottle.tar.gz
/usr/local/Cellar/a2ps/4.14: 281 files, 4.3M
 

So it works that way, though that's inconvenient for me. If you run with admin powers, this does seem to have value, but it's too clumsy for me.

See Homebrew without sudo for a possible fix; I did not try that.



Got something to add? Send me email.




Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Anthony Lawrence



Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us