MacOS M1 homebrew的安装

MAC homebrew安装

homebrew官网:https://brew.sh/

命令行安装

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

可能遇到的问题

1.SSL 443 问题

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused error
LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
产生问题可能的原因

1.网络连接问题:Github的raw文件读取地址遭受DNS污染,导致无法连接到网络。

2.Command line tool问题

解决方案

1.Github的raw文件读取地址遭受DNS污染

在终端中,使用vim修改hosts文件:

sudo vi /etc/hosts

查询IP后,将如下内容添加到hosts文件中:

199.232.4.133 raw.githubusercontent.com

2.重装command line tool

先卸载旧的command line tool:

rm -rf /Library/Developer/CommandLineTools

苹果官网下载,在下载界面搜索command。链接:Sign In - Apple

img

找一个适合自己电脑的版本,下载安装。

zsh: command not found: brew

编辑配置文件 ~/.zshrc,加入如下内容:

path=('/opt/homebrew/bin' $path)
export PATH

再执行:

source ~/.zshrc
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值