由于之前没做笔记,每次安装完以后就忘记了具体的安装步骤,结果在第二次安装新机的时候又会出现很多坑,为了避免入坑,现在将终极版的Homebrew安装步骤贴出来:
- 使用中科院的镜像
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/
2.
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
3. 把homebrew-core的镜像地址也设为中科院的国内镜像
cd "$(brew --repo)"
4.
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
5.
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
好了,到了这里估计会报出一个:
cd: no such file or directory: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
咋办呢?
容易解决:
6.
cd /usr/local/Homebrew/Library/Taps
7.
mkdir homebrew
8.
cd homebrew
9.
git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
10. 再来一次
cd "$(brew --repo)"
11.
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
12.
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
13.
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
14.
brew update
懂的都懂!