提示缺乏套件啦?別擔憂,Homebrew 隨時守候。git
$ brew install wget
Homebrew 會將套件安裝到獨立目錄,並將文件軟連接至/usr/local
。github
$ cd /usr/local $ find Cellar Cellar/wget/1.15 Cellar/wget/1.15/bin/wget Cellar/wget/1.15/share/man/man1/wget.1 $ ls -l bin bin/wget -> ../Cellar/wget/1.15/bin/wget
Homebrew 的全部文件均會被安裝到預約義目錄下,因此您無需擔憂 Homebrew 的安裝位置。ruby
輕鬆建立您的 Homebrew 程式。bash
$ brew create http://foo.com/bar-1.0.tgz Created /usr/local/Library/Formula/bar.rb
以 git、 ruby 爲其筋骨,因此藉助您的相關知識,自由修改,而且能夠簡單撤回您的調改或者合併上游更新。curl
$ brew edit wget # opens in $EDITOR!
Homebrew 的程式都是簡單的 Ruby 腳本:ui
require "formula" class Wget < Formula homepage "http://www.gnu.org/software/wget/" url "http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz" sha1 "f3c925f19dfe5ed386daae4f339175c108c50574" def install system "./configure", "--prefix=#{prefix}" system "make", "install" end end
Homebrew 使 OS X 更完美。使用 gem
來安裝 gems、用brew
來搞定那些依賴包。url
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
打開終端窗口, 粘貼以上腳本。spa
腳本會解釋它的做用,而後在您的確認下執行安裝。高級安裝選項請看 這裏(須要10.5)。code