M1 Mac安装原生 Homebrew
首先创建安装目录
sudo mkdir -p /opt/homebrew
将目录属主修改为当前用户,方便以后用当前用户直接brew install软件
sudo chown -R $(whoami) /opt/homebrew
进入 /opt 文件夹
cd /opt
直接下载homebrew tar包并解压
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
将路径增加到PATH环境变量中
如果使用的是zsh则直接修改~/.zshrc,如果使用的是bash,则修改~/.bash_profile
path=('/opt/homebrew/bin' $path)
export PATH
新开一个Terminal窗口或者在当前窗口让环境变量生效
source ~/.zshrc
现在可以安装软件了,注意要使用-s选项,表示编译源码安装
brew install -s wget
本文介绍如何在M1Mac上安装原生Homebrew。主要步骤包括:创建安装目录、设置目录权限、下载并解压Homebrew tar包、配置环境变量等。特别注意在安装软件时需使用-s选项进行源码编译。
2908

被折叠的 条评论
为什么被折叠?



