Mac OS X 下如何安装brew

什么是brew?

brew 又叫Homebrew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件,只需要一个命令,有点类似ubuntu系统下的apt-get的功能。

官方网站:http://brew.sh/

可以在其网页上找到安装方法:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
如果你用root权限进行安装,它会提示:Don't run this as root!

那就用普通账号进行安装吧!安装期间会让你输一次普通账号的密码,然后就耐心等待下载吧。

安装完后会有这么一段提示:

Run `brew doctor` before you installanything

那就按照它的提示来一趟吧~~~

执行完后一堆提示:

Please note that these warnings are just used to helpthe Homebrew maintainers

with debugging if you file an issue. If everythingyou use Homebrew for is

working fine: please don't worry and just ignorethem. Thanks!


Warning: python is symlinked to python3

This will confuse build scripts and in general leadto subtle breakage.


Warning: Python is installed at/Library/Frameworks/Python.framework


Homebrew only supports building against theSystem-provided Python or a

brewed Python. In particular, Pythons installed to/Library can interfere

with other software installs.


Warning: Unbrewed dylibs were found in/usr/local/lib.

If you didn't put them there on purpose they couldcause problems when

building Homebrew formulae, and may need to bedeleted.


Unexpected dylibs:

   /usr/local/lib/libevent-2.0.5.dylib

   /usr/local/lib/libevent_core-2.0.5.dylib

   /usr/local/lib/libevent_extra-2.0.5.dylib

   /usr/local/lib/libevent_openssl-2.0.5.dylib

   /usr/local/lib/libevent_pthreads-2.0.5.dylib

   /usr/local/lib/libGeoIP.1.dylib

   /usr/local/lib/libnettle.4.7.dylib


Warning: Unbrewed .la files were found in/usr/local/lib.

If you didn't put them there on purpose they couldcause problems when

building Homebrew formulae, and may need to bedeleted.


Unexpected .la files:

   /usr/local/lib/libevent.la

   /usr/local/lib/libevent_core.la

   /usr/local/lib/libevent_extra.la

   /usr/local/lib/libevent_openssl.la

   /usr/local/lib/libevent_pthreads.la

   /usr/local/lib/libGeoIP.la


Warning: Unbrewed .pc files were found in/usr/local/lib/pkgconfig.

If you didn't put them there on purpose they couldcause problems when

building Homebrew formulae, and may need to bedeleted.


Unexpected .pc files:

   /usr/local/lib/pkgconfig/geoip.pc

   /usr/local/lib/pkgconfig/libevent.pc

   /usr/local/lib/pkgconfig/libevent_openssl.pc

   /usr/local/lib/pkgconfig/libevent_pthreads.pc

   /usr/local/lib/pkgconfig/nettle.pc


Warning: Unbrewed static libraries were found in/usr/local/lib.

If you didn't put them there on purpose they couldcause problems when

building Homebrew formulae, and may need to bedeleted.


Unexpected static libraries:

   /usr/local/lib/libevent.a

   /usr/local/lib/libevent_core.a

   /usr/local/lib/libevent_extra.a

   /usr/local/lib/libevent_openssl.a

   /usr/local/lib/libevent_pthreads.a

   /usr/local/lib/libGeoIP.a

   /usr/local/lib/libnettle.a


Warning: /usr/bin occurs before /usr/local/bin

This means that system-provided programs will be usedinstead of those

provided by Homebrew. The following tools exist atboth paths:


    2to3

    memcached


Consider setting your PATH so that /usr/local/bin

occurs before /usr/bin. Here is a one-liner:

    echo exportPATH='/usr/local/bin:$PATH' >> ~/.bash_profile

------------------------

不管它,接下来就可以用brew来安装软件了

查找你要的组件:

brew search xxx

显示出结果:

xxx1 xxx2 xxxx3

选择你需要的组件安装:

brew install xxx1

卸载组件就是:

brew remove xxx1

如果哪天你不需要brew了,就按照以下命令卸载:

cd `brew –prefix`
rm -rf Cellar
brew prune
rm -rf Library .git .gitignore bin/brew README.mdshare/man/man1/brew
rm -rf ~/Library/Caches/Homebrew

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值