安装brew的正确姿势
brew
🍺 The missing package manager for macOS (or Linux)
项目地址:https://gitcode.com/gh_mirrors/br/brew
免费下载资源
·
你可能尝试了很多办法去安装brew,从一开始的网络超时,到一脸蒙的手动安装,本文教你如何正确安装brew
创建Homebrew目录
打开你的终端执行下面的命令,进行创建Homebrew
sudo mkdir /usr/local/Homebrew
同步brew.git库
sudo git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git /usr/local/Homebrew
添加环境变量
sudo ln -s /usr/local/Homebrew/bin/brew /usr/local/bin/brew
同步core库
sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
sudo git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
同步cask
sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
sudo git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
提权
sudo chown -R $(whoami) /usr/local/Cellar
查看版本号
brew -v
更换镜像源
此时你安装东西的话,还是会感受到超时的力量,所以我们需要更换国内镜像源
替换homebrew默认源
cd "$(brew --repo)"
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
bash用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile #刷新
zsh用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc #刷新
记得要更新
brew update
GitHub 加速计划 / br / brew
19
1
下载
🍺 The missing package manager for macOS (or Linux)
最近提交(Master分支:2 个月前 )
90a90b30
4 个月前
47b1cab7
4 个月前
更多推荐
已为社区贡献2条内容
所有评论(0)