Homebrew是Mac下软件包管理工具,他可以尽量使用系统自带的库,只要现有系统有的软件,就不会再次安装。
1、Homebrew的安装、卸载与更新:
https://github.com/mxcl/homebrew/wiki/Installation
1.1、系统要求
- An Intel CPU
- OS X 10.6 or higher
1.2、Install
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ==> This script will install: /usr/local/bin/brew /usr/local/Library/... /usr/local/share/man/man1/brew.1 Press RETURN to continue or any other key to abort ==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew Password: ==> Downloading and installing Homebrew... remote: Counting objects: 202201, done. remote: Compressing objects: 100% (54549/54549), done. remote: Total 202201 (delta 146509), reused 202141 (delta 146467) Receiving objects: 100% (202201/202201), 42.19 MiB | 31.00 KiB/s, done. Resolving deltas: 100% (146509/146509), done. From https://github.com/Homebrew/homebrew * [new branch] master -> origin/master HEAD is now at 0049b1a mercurial: update 3.1.2 bottle. ==> Installation successful! ==> Next steps Run `brew doctor` before you install anything Run `brew help` to get started
1.3、Uninstall
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
1.4、Update
brew --version 0.9.4 brew update Updated Homebrew from 32723234 to 32726535. brew --version 0.9.5
2、Homebrew使用
2.1、系统结构
ll /usr/local/ Cellar/ # download pkg, can hold multiple version Library/ # ├── Aliases # ├── ENV/ # xcode compile tools ├── Formula/ # pkg install config, such as nginx.rb2.2、软件管理
2.2.1、查看已经安装的软件
brew list
2.2.2. 搜索需要的软件并安装(search&install)
$ brew search rar gnu-scientific-library unrar $ brew install unrar