之前一直怀念ubuntu下的apt-get,因为实在是方便,需要安装什么,一个命令搞定,相关的依赖包统统由apt-get维护。下载,编译,安装,那叫一个痛快。什么软件用着不爽,一个命令卸载!
怀念apt-get之余,发现了替代工具MacPorts,据说也可以解决我的问题。但可惜,我总是无法更新本地软件索引库!
![](http://snowolf.iteye.com/images/smiles/icon_sad.gif)
homebrew主页对brew进行了详细的描述,不过我们更希望下载下来实战演练!
![](http://snowolf.iteye.com/images/smiles/icon_biggrin.gif)
- 安装brew
- 使用brew安装软件
- 使用brew卸载软件
- 使用brew检索软件
1.安装brew:
- curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1
上述命令,在官网上可以找到!
![点击查看原始大小图片](http://dl.iteye.com/upload/attachment/318436/99dfb24e-319b-35a7-94c8-e4fb98358e4f.png)
2.使用brew安装软件
别的工具不说,wget少不了,但是mac上默认没有!
![](http://snowolf.iteye.com/images/smiles/icon_sad.gif)
就先拿它来开刀了:
- brew install wget
![](http://dl.iteye.com/upload/attachment/318456/4a93389d-1819-36c0-9ec5-a4072af28c0a.png)
甚至是安装tomcat:
- brew install tomcat
![](http://dl.iteye.com/upload/attachment/318460/6715f667-da1c-3cb9-aae2-993c0ca91e74.png)
或者是unrar:
- brew install unrar
![](http://dl.iteye.com/upload/attachment/318462/ea7ab6d3-3a2a-3ca9-aee7-e489deef2fb9.png)
3.使用brew卸载软件
安装简单,卸载就更简单了:
- brew uninstall unrar
![](http://dl.iteye.com/upload/attachment/318474/81e69574-45fb-367b-84c5-a05b8415f10b.png)
4.使用brew检索软件
看看我们能搜到什么:
- brew search /apache*/
![](http://dl.iteye.com/upload/attachment/0031/8493/744b844d-d5f4-3459-97cb-c1b027475ebb.png)
/apache*/使用的是正则表达式,注意使用/分隔!
至此,brew已经能解决我的大部分软件安装问题了!
![](http://snowolf.iteye.com/images/smiles/icon_biggrin.gif)