朋友啊干了这杯酒!

什么是Homebrew?

Homebrew 是macOS 缺失的软件包管理器,能在Mac中方便的安装软件或者卸载软件,Homebre可以在Mac上安装一些OS X没有的UNIX工具,统统安装到 /usr/local/Cellar 目录中,并在 /usr/local/bin 中创建符号链接。


如何安装

将以下命令粘贴至终端并运行。

1
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

使用 Homebrew 安装 Apple 没有预装但 你需要的东西

1
$ brew install wget

Homebrew 会将软件包安装到独立目录,并将其文件软链接至 /usr/local 。

1
2
3
4
5
6
7
8
$ 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


如何使用

代码走你:

1
2
3
4
5
6
7
8
$ brew install <packageName>
$ brew uninstall <packageName>
$ brew search <packageName>
$ brew info <packageName>
$ brew list <!-- 查看已安装包列表 -->
$ brew update
$ brew -v
$ brew -h