1、brew常用命令
以boost库安装为例:
安装命令如下所示:
brew install boost #安装boost
brew search boost #查看有那些可安装版本
brew list boost #查看本机安装boost所在路径
2、brew安装慢的解决方法
如果安装过慢,可以采用其他源的方式进行安装。
- 替换为中科大源
#替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
#替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
- 切换回官方源
#重置brew.git:
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
#重置homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
参考: