0
点赞
收藏
分享

微信扫一扫

Mac 安装 homebrew - M1芯片

松鼠树屋 2022-02-14 阅读 139
macosbash
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"

# 然后根据提示设置环境变量
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/lh.hc/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

# 查看是否安装完成
which brew

安装完成后,设置 brew 的镜像源,我这里以阿里云的镜像源为例,我的默认 shell 为 zsh

  1. 查看此电脑的默认 bash
echo $SHELL
  1. 更新镜像源
    # 替换brew.git:
    cd "$(brew --repo)"
    git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
    # 替换homebrew-core.git:
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
    # 应用生效
    brew update
    # 替换homebrew-bottles:
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
    source ~/.zshrc

举报

相关推荐

0 条评论