解决Mac安装Homebrew失败

首先使用Homebrew官网的安装shell命令安装:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

会出现如下错误(或许是网络或者其他原因):

fatal: unable to access 'https://github.com/Homebrew/brew/': error:02FFF036:system library:func(4095):Connection reset by peer
Failed during: git fetch --force origin

我试了网上的各种办法,改hosts、git config --global http proxy都不行。我们可以使用gtee代理的下载地址:

/bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

下载选择1,y。

直至安装完成会发现,环境变量也自动配置好了,brew可以直接使用(brew help试试)。如果不行,先执行下source /Users/zcm/.zprofile。

 source /Users/zcm/.zprofile

查看brew命令help

brew help

 

posted @ 2022-10-26 17:01  君临天下之徐少  阅读(2299)  评论(0编辑  收藏  举报