很好用的包管理工具晨川!
獲取 Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
打開終端窗口, 粘貼以上腳本届垫。
腳本會解釋它的作用西乖,然后在您的確認下執(zhí)行安裝。高級安裝選項請看 這里(需要10.5)。
What Does Homebrew Do?
又提示缺少套件啦?別擔心,Homebrew 隨時守候陶缺。
$ brew install wget
Homebrew 會將套件安裝到獨立目錄,并將文件軟鏈接至 /usr/local 洁灵。
$ cd /usr/local
$ find Cellar
Cellar/wget/1.16.1
Cellar/wget/1.16.1/bin/wget
Cellar/wget/1.16.1/share/man/man1/wget.1
$ ls -l bin
bin/wget -> ../Cellar/wget/1.16.1/bin/wget
Homebrew 的所有文件均會被安裝到預(yù)定義目錄下饱岸,所以您無需擔心 Homebrew 的安裝位置掺出。
輕松創(chuàng)建您的 Homebrew 程式。
$ brew create https://foo.com/bar-1.0.tgz
Created /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bar.rb
以 git苫费、 ruby 為其筋骨汤锨,所以借助您的相關(guān)知識,自由修改百框,并且可以簡單撤回您的調(diào)改或者合并上游更新闲礼。
$ brew edit wget # 使用 $EDITOR 編輯!
Homebrew 的程式都是簡單的 Ruby 腳本:
class Wget < Formula
homepage "https://www.gnu.org/software/wget/"
url "https://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz"
sha256 "52126be8cf1bddd7536886e74c053ad7d0ed2aa89b4b630f76785bac21695fcd"
def install
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end
end
Homebrew 使 macOS 更完美。使用 gem 來安裝 gems铐维、用 brew 來搞定那些依賴包柬泽。
更多文檔
https://git.io/brew-docs
Community Discussion
http://discourse.brew.sh
Homebrew Blog
http://brew.sh/blog