mac osx10.11 安裝homebrew
周海漢 2016.10.27
osx 10.11後/usr/local許可權變嚴了。所以先改目錄許可權
zhhmac:local zhouhh$ sudo chown zhouhh:admin .
安裝 zhhmac:local zhouhh$ /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
新增國內映象。 如清華homebrew 由於眾所周知的原因,homebrew國外源非常慢,甚至直接失敗。所以需要設定國內映象。但目前清華映象官方的說明已經過時。
`zhhmac:local zhouhh$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git fatal: Not a git repository (or any of the parent directories): .git zhhmac:local zhouhh$ cd Homebrew/
zhhmac:Homebrew zhouhh$ pwd
/usr/local/Homebrew
zhhmac:Homebrew zhouhh$ git status
On branch stable
nothing to commit, working directory clean
zhhmac:Homebrew zhouhh$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
zhhmac:Homebrew zhouhh$ pwd
/usr/local/Homebrew
zhhmac:Homebrew zhouhh$ cd ..
zhhmac:local zhouhh$ ls
Cellar bin lib share
Frameworks etc opt var
Homebrew include sbin
zhhmac:local zhouhh$ cd ./Homebrew/Library/Taps/homebrew/homebrew-core/
zhhmac:homebrew-core zhouhh$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
zhhmac:homebrew-core zhouhh$ brew update
Already up-to-date.
zhhmac:homebrew-core zhouhh$ `
homebrew二進位制的下載。 (homebrew-bottles映象) 長期替換映象: ` echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles’ » ~/.bash_profile source ~/.bash_profile ` 如果用zsh
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
參考 https://mirrors.tuna.tsinghua.edu.cn/help/homebrew-bottles/ https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
如非註明轉載, 均為原創. 本站遵循知識共享CC協議,轉載請註明來源