Homebrew简称brew,OSX上的软件包管理工具,在Mac终端能够经过brew安装、更新、卸载软件。html
一、打开终端直接输入下面指令回车:git
注意:若是当前的用户是管理员,须要对权限进行许可,在执行上面的指令前先执行:sudo chmod -R g+w /usr/local
github
二、在1中指令回车后会提示“Press RETURN to continue or any other key to abort”(回车继续或者按其余键终止),这是直接回车进入“Downloading and installing Homebrew...”,若是网络很差的话可能会提示“fatal: unable to access 'https://github.com/Homebrew/brew/': SSLRead() return error -9806...等”,不要紧从新输入1的指令更新。ruby
三、更新完成后的提示以下图所示:bash
四、经常使用的三条语句搜索(search)、更新(install)、卸载(remove)网络
搜索:brew search SoftwareNameapp
更新:brew install SoftwareNamecurl
卸载:brew remove SoftwareName工具
(SoftwareName 是你须要处理的软件名)fetch
五、下面是我安装时的过程代码(仅供参考):
Last login: Wed May 10 08:44:45 on consoleuserdeMacBook-Pro:~ lijinkui$ sudo chmod -R g+w /usr/localPassword:userdeMacBook-Pro:~ lijinkui$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"==> This script will install:/usr/local/bin/brew/usr/local/share/doc/homebrew/usr/local/share/man/man1/brew.1/usr/local/share/zsh/site-functions/_brew/usr/local/etc/bash_completion.d/brew/usr/local/Homebrew==> The following existing directories will be made writable by user only:/usr/local/share/zsh/usr/local/share/zsh/site-functionsPress RETURN to continue or any other key to abort==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/share/zsh /usr/local/share/zsh/site-functions==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions==> Downloading and installing Homebrew...fatal: unable to access 'https://github.com/Homebrew/brew/': SSLRead() return error -9806Failed during: git fetch origin master:refs/remotes/origin/master --tags --force --depth=1userdeMacBook-Pro:~ lijinkui$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"==> This script will install:/usr/local/bin/brew/usr/local/share/doc/homebrew/usr/local/share/man/man1/brew.1/usr/local/share/zsh/site-functions/_brew/usr/local/etc/bash_completion.d/brew/usr/local/HomebrewPress RETURN to continue or any other key to abort==> Downloading and installing Homebrew...remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0HEAD is now at f1d4c4b Merge pull request #2607 from MikeMcQuaid/travis-ci-tweaks-2==> Tapping homebrew/coreCloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...remote: Counting objects: 4408, done.remote: Compressing objects: 100% (4213/4213), done.remote: Total 4408 (delta 37), reused 454 (delta 15), pack-reused 0Receiving objects: 100% (4408/4408), 3.52 MiB | 298.00 KiB/s, done.Resolving deltas: 100% (37/37), done.Tapped 4213 formulae (4,451 files, 11MB)==> Cleaning up /Library/Caches/Homebrew...==> Migrating /Library/Caches/Homebrew to /Users/lijinkui/Library/Caches/Homebre==> Deleting /Library/Caches/Homebrew...Already up-to-date.Error: Could not link:/usr/local/share/man/man1/brew.1Please delete these paths and run `brew update`.Error: Could not link:/usr/local/share/doc/homebrewPlease delete these paths and run `brew update`.==> Installation successful!==> Homebrew has enabled anonymous aggregate user behaviour analytics.Read the analytics documentation (and how to opt-out) here: http://docs.brew.sh/Analytics.html==> Next steps:- Run `brew help` to get started- Further documentation: http://docs.brew.shuserdeMacBook-Pro:~ lijinkui$ brew updateAlready up-to-date.