转载 m1 适配homebrew

转载https://www.bilibili.com/video/BV11i4y1c7BD?from=search&seid=3913240024604725138

1. 安装 ARM 版 Homebrew

        

cd /opt # 切换到 /opt 目录

mkdir homebrew # 创建 homebrew 目录

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

Intel安装

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

vim ~/.zshrc 或者 vim ~/.bash_profile

# x86
  export PATH ="/usr/local/bin:$PATH"
  export abrew="arch -x86_64 /usr/local/bin/brew"

# arm
  export PATH="/opt/homebrew/bin:$PATH"
  alias brew="/opt/homebrew/bin/brew"

source ~/.zshrc 或者 source ~/.bash_profile

2.换源

# arm版
  cd "$(brew --repo)"
  git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
  cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
  git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git

#intel 版
  cd "$(abrew --repo)"
  git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
  cd "$(abrew --repo)/Library/Taps/homebrew/homebrew-core"
  git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.gitE


替换homebrew-bottles  (预编译如今只软件包)
bash用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirror.ustc.edu.cn/homebrew-bottles' >>~/.bash_profile
source ~/.bash_profile

zsh用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirror.ustc.edu.cn/homebrew-bottles' >>~/.zshrc
source ~/.zshrc
  

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值