Mac电脑安装homebrew

200 阅读1分钟

Mac电脑安装配置homebrew,因为之前使用github网络不通,所以在线安装脚本会出问题。

==> Downloading and installing Homebrew...
fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443 after 75016 ms: Couldn't connect to server
Warning: Trying again in 2 seconds: /usr/bin/git fetch --quiet --progress --force origin
fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443 after 75013 ms: Couldn't connect to server
Warning: Trying again in 4 seconds: /usr/bin/git fetch --quiet --progress --force origin
fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443 after 75013 ms: Couldn't connect to server
Warning: Trying again in 8 seconds: /usr/bin/git fetch --quiet --progress --force origin

切换到国内gitgree,在线下载并安装

  1. 执行下面命令
/bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
  1. 一路按照提示,回车大法,无脑执行就可以
Homebrew已经安装成功,接下来配置国内软件下载源。

请选择今后brew install的时候访问那个国内镜像,例如阿里巴巴,输入5回车。

1、中科大国内源
2、清华大学国内源
3、上海交通大学国内源
4、腾讯国内源
5、阿里巴巴国内源(推荐)
请输入序号: 5
  1. 选择阿里巴巴国内源就可以

这样就安装成功了