下載命令:
1 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
卸載命令:
1 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" 2 cd `brew –prefix` 3 rm -rf Cellar 4 brew prune 5 rm `git ls-files` 6 rm -rf Library .git .gitignore bin/brew 7 rm -rf README.md share/man/man1/brew 8 rm -rf Library/Homebrew Library/Aliases 9 rm -rf Library/Formula Library/Contributions 10 rm -rf ~/Library/Caches/Homebrew
檢查:
//查看brew的幫助: brew –help //安裝軟件: brew install git //卸載軟件: brew uninstall git //搜索軟件: brew search git //顯示已經安裝軟件列表: brew list //更新軟件,把所有的Formula目錄更新,並且會對本機已經安裝並有更新的軟件用*標明。:brew update //更新某具體軟件: brew upgrade git //查看軟件信息: brew [info | home] [FORMULA...] //刪除程序,和upgrade一樣,單個軟件刪除和所有程序老版刪除。 brew cleanup git brew cleanup //查看那些已安裝的程序需要更新: brew outdated //其它Homebrew指令: brew list //—列出已安裝的軟件 brew update //—更新Homebrew brew home * //—用瀏覽器打開 brew info * //—顯示軟件內容信息 brew deps * //—顯示包依賴 brew server * //—啟動web服務器,可以通過瀏覽器訪問 //http://localhost:4567/ 來同網頁來管理包 brew -h brew //—幫助
國內安裝方式:
1 1、創建Homebrew插件目錄 2 sudo mkdir /usr/local/Homebrew sudo git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git /usr/local/Homebrew 3 4 2、創建軟連接 5 sudo ln -s /usr/local/Homebrew/bin/brew /usr/local/bin/brew 如果文件已存在,則執行sudo rm -rf /usr/local/bin/brew 6 7 3、創建並同步homebrew-core、homebrew-cask 8 sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core sudo git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask sudo git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask 9 10 4、授權 11 sudo chown -R $(whoami) /usr/local/Homebrew sudo chown -R $(whoami) /usr/local/Homebrew/Library/Taps/homebrew sudo chown -R $(whoami) /usr/local/Cellar 12 13 5、驗證 14 brew -v