Apple MacBookPro M1 安装 brew(国内源)
1. 依赖
git
git安装方法:
下载安装包地址:https://git-scm.com/download/mac
Binary installer
Tim Harper provides an installer for Git. The latest version is 2.27.0, which was released 5 months ago, on 2020-07-22.
2. 准备目录
M1之后,不能放到 /usr/local/bin目录下了。要放到/opt目录下 所以新建/opt目录,cd /opt && sudo chmod -R 777 ./ 授权给所有用户所有权限
3. 下载安装脚本
cd /opt && curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh > Homebrew.sh
4. 打开脚本修改安装目录
vim /opt/Homebrew.sh
将 HOMEBREW_PREFIX的值修改成 HOMEBREW_PREFIX="/opt" 并保存
5. 执行安装命令
cd /opt && /bin/zsh Homebrew.sh
建议选择腾讯或者是阿里
6 . 配置环境变量
sudo vim /etc/profile 在最后一行添加 export PATH=$PATH:/opt/Homebrew/bin
source /etc/profile
最好是重启一下电脑,让环境变量永远生效
7. 执行brew -v
/opt/Homebrew/bin/brew: line 11: cd: /usr/local/Homebrew/bin: No such file or directory
Homebrew 2.5.6-74-g4e8d374-dirty
Homebrew/homebrew-core (git revision d1b6d; last commit 2020-10-19)
Homebrew/homebrew-cask (git revision 82aec0; last commit 2020-12-15)
更多推荐
所有评论(0)