mac m1安装homebrew

1、安装

切换到/opt目录

cd /opt

创建homebrew目录

sudo mkdir homebrew

修改目录所属用户

sudo chown -R $(whoami) /opt/homebrew

安装Arm版Homebrew

curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

2、配置环境变量
export PATH="/opt/homebrew/bin:$PATH"
alias brew='/opt/homebrew/bin/brew'

我配置完homebrew完事报错了:/opt/homebrew/bin/brew: line 11: cd: /usr/local/Homebrew/bin: No such file or directory,运行下面指令就好了
sudo rm -rf /usr/local/bin/brew

你可能感兴趣的:(mac m1安装homebrew)