17

Mac 安装 brew

 3 years ago
source link: https://www.jitwxs.cn/c9822fb1.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Jitwxs

Mac 安装 brew

Jitwxs|发表于2020-09-26|更新于2020-12-19|开发工具
字数总计:364|阅读时长:1分钟|阅读量:15|评论数:0

brew 是 Mac 和 Linux 下的包管理器,但是需要手动安装,在国内操蛋的网络环境下,想要不翻墙安装,还得花点功夫。本文记录在非翻墙情况下,如何安装 brew

二、安装流程

2.1 官方步骤

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

以上为官方推荐的安装步骤,但是如果你没有开翻墙的话,大概率是会失败的。

2.2 国内镜像-1

可以使用以下命令,傻瓜操作。但是很遗憾我的电脑用不了,一直提示没有文件权限。

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

2.3 国内镜像-2

这个方法在本机上能够成功安装、

/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"

在安装过程中,可能会卡在 Tapping homebrew/core 这一步,如下图所示。

loading.gif

这时候直接 Control + C 结束执行,手动依次执行以下命令:

cd "$(brew --repo)/Library/Taps/"
mkdir homebrew && cd homebrew
git clone git://mirrors.ustc.edu.cn/homebrew-core.git

执行完毕后重新执行最初的命令即可:

/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"

最后提示 ==> Installation successful! 就安装完毕了。

如果想要卸载 brew,使用如下命令即可:

/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/uninstall)"

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK