brew安裝
brew是mac下的一個超級安裝工具,其功能和Linux下的yum、apt-get類似。
1、下載下傳安裝
cd /usr/local
建立安裝目錄:
sudo mkdir homebrew
下載下傳二進制檔案
curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C /usr/local
mv Homebrew-legacy-homebrew-5a9e19f/* homebrew/
添權重限
sudo chmod 755 homebrew/
sudo chown -R yangjifei
進入安裝目錄
cd homebrew/bin
檢視版本,并更新brew庫:
./brew -v
./brew update
2、設定環境變量
在.base_profile檔案中增加:
export PATH=$PATH:/usr/local/homebrew/bin
3、使用方法
如:lzsz下載下傳
brew install wget
如果想解除安裝lzsz執行
brew uninstall wget
-----------------------------------排錯-------------------------------
localhost:bin yangjifei$ sudo brew install lrzsz
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
localhost:bin yangjifei$
解決:
使用 sudo chown -R yangjifei homebrew
再執行以上步驟