mac中的homebrew非常方便,但是安装的时候,却有些麻烦,因为墙的存在我们的安装总会超时报错等。好在国内有一些镜像能让我们使用,比如中科大的镜像,其他的还有清华源等,但是清华的总是失败

中科大镜像地址

https://mirrors.ustc.edu.cn/

安装步骤

  • 在终端中执行命令,创建Homebrew目录
sudo mkdir /usr/local/Homebrew
  • 同步中科大的brew库
sudo git clone https://mirrors.ustc.edu.cn/brew.git /usr/local/Homebrew
  • 添加环境变量
sudo ln -s /usr/local/Homebrew/bin/brew /usr/local/bin/brew
  • 同步中科大homebrew-core库
sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
sudo git clone https://mirrors.ustc.edu.cn/homebrew-core.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
  • 同步中科大homebrew-cask库
sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
sudo git clone https://mirrors.ustc.edu.cn/homebrew-cask.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
  • 账号赋权,cellar是brew的软件安装目录
sudo chown -R $(whoami) /usr/local/Cellar
  • 查看版本号
brew -v

相关文章:

  • 2021-10-08
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2021-11-17
  • 2022-12-23
猜你喜欢
  • 2021-07-02
  • 2021-04-14
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案