记录| mac M1 homebrew安装

homebrew官网的代码不管用

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

参照这个知乎文章管用

/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"

也就是可能连不上raw.githubusercontent.com的服务器但是可以练到gitee.com

执行成功,但是去吃饭之前出现这两个问题(卡住了,还在继续安装, 等回来看看)
在这里插入图片描述
没问题
在这里插入图片描述

根据文章和提示,开始配置环境变量
查看「终端类型」

echo $SHELL

/bin/bash => bash => .bash_profile
/bin/zsh => zsh => .zprofile
在这里插入图片描述
所以本macbookpro的终端默认为zsh,使用.zprofile
对应命令为:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

查看是否安装成功

homebrew -v
homebrew --version

在这里插入图片描述