Homebrew installs the stuff you need that Apple didn’t. It’s a package manager for mac os just like apt-get or yum package managers for RedHat and Debian linux systems. It makes your life easier to install lots of packages in a single command just like linux. I love Homebrew package manager and i use it on my MacBook Pro.
1 2 3 | $ brew install wget |
Homebrew installs packages to their own directory and then symlinks their files into /usr/local.
1 2 3 4 5 6 7 8 9 10 | $ cd /usr/local $ find Cellar Cellar/wget/1.12 Cellar/wget/1.12/bin/wget Cellar/wget/1.12/share/man/man1/wget.1 $ ls -l bin bin/wget > ../Cellar/wget/1.12/bin/wget |
Homebrew won’t install files outside its prefix, and you can place a Homebrew installation wherever you like.
Trivially create your own Homebrew packages.
1 2 3 4 | $ brew create http://foo.com/bar-1.0.tgz Created /usr/local/Library/Formula/bar.rb |
It’s all git and ruby underneath, so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.
1 2 3 | $ brew edit wget # opens in $EDITOR! |
Homebrew formulae are simple Ruby scripts:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | require 'formula' class Wget > Formula homepage 'http://www.gnu.org/wget/' url 'http://ftp.gnu.org/wget-1.12.tar.gz' md5 '308a5476fc096a8a525d07279a6f6aa3' def install system "./configure --prefix=#{prefix}" system 'make install' end end |
Homebrew complements OS X. Install your gems with gem, and their dependencies with brew.
Install Homebrew
1 2 3 | $ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" |
The script explains what it will do and then pauses before it does it. There are more installation options here (needed on 10.5).
Troubleshooting
– First, please run brew update and brew doctor.
1 2 3 4 | $ brew update $ brew doctor |
RESULT:
1 2 3 4 5 6 7 8 | $ brew update Updated Homebrew from ad741405 to 728206df. ==> Updated Formulae daemon homebank hicolor-icon-theme scons$ brew doctor Your system is ready to brew. |
Important Links
– Install Homebrew
– FAQ
– Tips n’ Tricks
[aio_button align=”none” animation=”none” color=”red” size=”small” icon=”none” text=”Homebrew GitHub” target=”_blank” relationship=”dofollow” url=”https://github.com/Homebrew/homebrew”] [aio_button align=”none” animation=”none” color=”red” size=”small” icon=”none” text=”Homebrew Official Site” target=”_blank” relationship=”dofollow” url=”http://brew.sh/”]