Mac M1安装Homebrew记录

1、异常

Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
  https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
  brew bundle dump

由于我是从老的MacBook Pro迁移到M1的,所以老的Homebrew版本在M1 ARM上已经不可用了。

2、安装Homebrew

2.1、执行安装命令

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

国内环境可用

安装需要电脑密码:

==> Checking for `sudo` access (which may request your password).
Password:

输入会继续执行下载安装。

安装完成会有提示:
在这里插入图片描述

可以执行命令brew help验证是否安装完成。

2.2、配置环境

如上图所示,需要配置一下Homebrew环境

2.2.1、终端类型

先查看自己的终端类型

执行命令:

echo $SHELL

在这里插入图片描述

执行结果:

  • /bin/bash => bash => .bash_profile
  • /bin/zsh => zsh => .zprofile

2.2.2、配置环境

在你的.bash_profile文件或.zprofile文件中添加安装完成所提示的环境配置。

在访达的个人空间中,快捷键command+shift+.可以把隐藏文件显示出来。

我的按照提示即添加如下:

cho 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/yechao/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

然后执行命令刷新环境即可

source ~/.bash_profile 

or

source ~/.zprofile

ok,剩下的就是自己玩耍了。

3、相关资料

  • https://docs.brew.sh/Installation
  • https://brew.idayer.com/guide/m1/
  • https://stackoverflow.com/questions/66666134/how-to-install-homebrew-on-m1-mac
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yechaoa

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值