Mac终端中使用brew出错,国内安装brew
使用
# 官方安装方式
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
安装Homebrew报错 url: (7) Failed to connect to raw.githubusercontent.com port 443 after 4 ms: Couldn‘‘t connect to,无法连接GitHub, 不能安装,那就直接使用这个文件吧,下载此文件,在终端中打开文件所在目录,运行
/bin/bash install.sh
.sh脚本
资源及说明看下面:
https://download.youkuaiyun.com/download/aifengaopeng/90020061
或者使用国内可用的仓库的地址gitee
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
# /bin/bash -c "$(curl -fsSL https://gitee.com/lxfap/Homebrew/raw/master/install.sh)"
.pkg软件包
https://download.youkuaiyun.com/download/aifengaopeng/90020100
安装步骤
1、 下载安装包直接安装
2、 安装完成后在终端输入brew -v
查看版本号
3、 如果无法查到大概率是环境变量未设置,步骤:使用 vim ~/.zprofile
创建并编辑文件,输入以下代码 export PATH="/opt/homebrew/bin:$PATH"
后保存退出,再执行source ~/.zprofile
。再我查看版本号,成功