mac安装brew 软件包管理工具Homebrew

brew 全称Homebrew  是Mac OSX上的软件包管理工具html

Homebrew 安装和卸载工具 只用一行命令就能完成java

官方地址:    http://brew.sh/index.htmlgit

 

 
mac 自带ruby    
打开命令行  terminal  
输入  :
[java]  view plain  copy
 
 在CODE上查看代码片派生到个人代码片
  1. ruby -version  
 

1) 安装命令  

 
[java]  view plain  copy
 
 在CODE上查看代码片派生到个人代码片
  1. ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"  

假如已经安装了  输入以下命令
 
[java]  view plain  copy
 
 在CODE上查看代码片派生到个人代码片
  1. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"  

命令行输出:
 
 

2) brew 使用方法

命令行 输入:  brewgithub

 

输出:浏览器

 

[java]  view plain  copy
 
 在CODE上查看代码片派生到个人代码片
  1. Example usage:  
  2.   brew [info | home | options ] [FORMULA...]  
  3.   brew install FORMULA...  
  4.   brew uninstall FORMULA...  
  5.   brew search [foo]  
  6.   brew list [FORMULA...]  
  7.   brew update  
  8.   brew upgrade [FORMULA...]  
  9.   brew pin/unpin [FORMULA...]  
  10.   
  11. Troubleshooting:  
  12.   brew doctor  
  13.   brew install -vd FORMULA  
  14.   brew [--env | config]  
  15.   
  16. Brewing:  
  17.   brew create [URL [--no-fetch]]  
  18.   brew edit [FORMULA...]  
  19.   open https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md  
  20.   
  21. Further help:  
  22.   man brew  
  23.   brew home  

 

 

3) 安装工具

 

举个栗子:   wget  这个工具ruby

输入命令:   brew install wget curl

如图:工具

 

 

4)  卸载

拿上面的栗子:   wget 工具fetch

输入命令    brew uninstall wget网站

 

5)  工具安装的目录

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

 

[java]  view plain  copy
 
 在CODE上查看代码片派生到个人代码片
  1. $ cd /usr/local  
  2. $ find Cellar  
  3. Cellar/wget/1.16.1  
  4. Cellar/wget/1.16.1/bin/wget  
  5. Cellar/wget/1.16.1/share/man/man1/wget.1  
  6.   
  7. $ ls -l bin  
  8. bin/wget -> ../Cellar/wget/1.16.1/bin/wget  

 

 

 
 
Homebrew 的全部文件均会被安装到预约义目录下,因此无需担忧 Homebrew 的安装位置。

 

 

6) 其余命令

 

brew list           列出已安装的软件

brew update     更新brew

brew home       用浏览器打开brew的官方网站

brew info         显示软件信息

brew deps        显示包依赖

 

      更多命令请看:    https://git.io/brew-docs