安装 Homebrew / Linuxbrew

首先,需要确保系统中安装了 bash、git 和 curl,对于 macOS 用户需额外要求安装 Command Line Tools (CLT) for Xcode。

对于 macOS 用户,系统自带 bash、git 和 curl,在命令行输入 xcode-select --install 安装 CLT for Xcode 即可。
对于 Linux 用户,系统自带 bash,仅需额外安装 git 和 curl。
接着,在终端输入以下几行命令设置环境变量:

if [[ “ ( u n a m e − s ) " = = " L i n u x " ] ] ; t h e n B R E W T Y P E = " l i n u x b r e w " ; e l s e B R E W T Y P E = " h o m e b r e w " ; f i e x p o r t H O M E B R E W B R E W G I T R E M O T E = " h t t p s : / / m i r r o r s . t u n a . t s i n g h u a . e d u . c n / g i t / h o m e b r e w / b r e w . g i t " e x p o r t H O M E B R E W C O R E G I T R E M O T E = " h t t p s : / / m i r r o r s . t u n a . t s i n g h u a . e d u . c n / g i t / h o m e b r e w / (uname -s)" == "Linux" ]]; then BREW_TYPE="linuxbrew"; else BREW_TYPE="homebrew"; fi export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git" export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/ (unames)"=="Linux"]];thenBREWTYPE="linuxbrew";elseBR

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值