mac os x 10.8 安装homebrew过程

什么是homebrew:
通过终端简单及灵活的方式来安装苹果没有自带的UNIX工具软件
http://brew.sh/index_zh-cn.html

安装前准备:
安装Homebrew: 首先, Homebrew 声明自己和 MacPorts 和 Fink 不兼容,安装前检查删除他们.
删除MacPorts:
#原版使用MacPorts安装过的软件在/opt/local目录下,删除之前最好查看下,心里有个数.
sudo port -f uninstall installed
sudo rm -rf \
/opt/local \
/Applications/DarwinPorts \
/Applications/MacPorts \
/Library/LaunchDaemons/org.macports.* \
/Library/Receipts/DarwinPorts*.pkg \
/Library/Receipts/MacPorts*.pkg \
/Library/StartupItems/DarwinPortsStartup \
/Library/Tcl/darwinports1.0 \
/Library/Tcl/macports1.0 \
~/.macports


如何安装:
HomeBrew是ruby脚本,但是mac下不需要安装ruby解释环境,系统自带了。 
oujinyangmatoMacBook-Air:bin wangjinyang$ ruby -e "$(/usr/bin/curl -fsSkL raw.github.com/mxcl/homebrew/go)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1

Press ENTER to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin /usr/local/share /usr/local/share/man /usr/local/share/man/man1
==> Downloading and Installing Homebrew...

remote: Finding bitmap roots...
remote: Counting objects: 130043, done.
remote: Compressing objects: 100% (41100/41100), done.
remote: Total 130043 (delta 89687), reused 128212 (delta 87922)
Receiving objects: 100% (130043/130043), 30.85 MiB | 152 KiB/s, done.
Resolving deltas: 100% (89687/89687), done.
From https://github.com/mxcl/homebrew
 * [new branch]      master     -> origin/master
HEAD is now at 6ebb2cb go --devel 1.2RC1
Warning: Install the "Command Line Tools for Xcode": http://connect.apple.com
==> Installation successful!
You should run `brew doctor' *before* you install anything.
Now type: brew help

如何使用?:
1、检查brew
oujinyangmatoMacBook-Air:bin wangjinyang$ brew doctor
Warning: Your Xcode (4.6.2) is outdated
Please install Xcode 4.6.3.

2、查询homebrew版本
oujinyangmatoMacBook-Air:bin wangjinyang$ brew -v
Homebrew 0.9.5

3、使用homebrew安装wget
oujinyangmatoMacBook-Air:bin wangjinyang$ brew install wget
Warning: Your Xcode (4.6.2) is outdated
Please install Xcode 4.6.3.
==> Downloading http://ftpmirror.gnu.org/wget/wget-1.14.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/wget/1.14 --sysconfdir=/usr/local/etc --with-ssl=openssl --disable-iri

==> make install

猜你喜欢

转载自wangjinyang.iteye.com/blog/1945838