Homebrew
Homebrew安裝
- 提前安裝Xcode(App Store)和ruby(系統自帶);
- 在命令行輸入下列代碼:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)
- 盡量不要使用6.3,網上很多gcc編譯器出錯無法編譯等問題,大家都猜測是xcode最近的更新導致的
Homebrew使用
下面用git舉例:
安裝軟件
brew install git
卸載軟件brew uninstall git
搜索軟件brew search git
更新軟件brew upgrade git
重新安裝brew reinstall git
刪除軟件brew cleanup git
查看哪些軟件需要更新brew outdated
更新所有軟件brew upgrade
顯示已經安裝的軟件列表brew list
Homebrew文件存儲位置
/usr/local/bin
用於存放所安裝程序的啟動鏈接(相當於快捷方式)
/usr/local/Cellar
所以brew安裝的程序,都將以[程序名/版本號]存放於本目錄下
/usr/local/etc
brew安裝程序的配置文件默認存放路徑
/usr/local/Library
Homebrew 系統自身文件夾
利用Homebrew-cask安裝應用程序
-
Homebrew-cask可以幫助你簡潔的一鍵安裝各種軟件
-
Homebrew-cask安裝:
$ brew tap phinze/homebrew-cask && brew install brew-cask
==> Tapping phinze/cask
Cloning into '/usr/local/Library/Taps/phinze/homebrew-cask'...
....
-
homebrew-cask使用:
brew cask install xxx
安裝xxx軟件
brew cask search
查詢所有可以被安裝的軟件
brew cask search drop
查找所有和 drop 有關的的軟件
brew cask info xxx
查看xxx的應用信息
brew cash uninstall xxx
卸載xxx
brew update && brew upgrade
更新所有應用程序
Homebrew報錯
-
可以重新安裝(后面是我重裝時的提示信息):brew reintall xxx
$ pkg_config -bash: pkg_config: command not found $ brew reinstall pkg-config ==> Reinstalling pkg-config ==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.28.yosemite.bo Already downloaded: /Library/Caches/Homebrew/pkg-config-0.28.yosemite.bottle.2.tar.gz ==> Pouring pkg-config-0.28.yosemite.bottle.2.tar.gz 🍺 /usr/local/Cellar/pkg-config/0.28: 10 files, 612K $ pkg-config Must specify package names on the command line