安装HomeBrew 失败的解决方案(Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!)

在安装HomeBrew(或者安装成功 执行相关指令)时遇到错误提示

Error: Failure while executing: git clone https://github.com/Homebrew/homebrew-core /usr/local/Library/Taps/homebrew/homebrew-core --config core.autocrlf=false --depth=1 -q
Error: Failure while executing: /usr/local/bin/brew tap homebrew/core -q

解决方案:

在终端中依次执行sudo chown -R apple:staff *brew doctor两个命令如下图:

localhost:~ sant$ sudo chown -R apple:staff *
localhost:~ sant$ brew doctor

待指令执行结束,homebrew 也就修复好了。

 

有小伙伴反应在执行

sudo chown -R apple:staff 

命令时 会提示 chown: apple: illegal user name

出现这个提示的原因是找不到apple 这个用户

解决方案也很简单:

在终端中执行  whoami 命令,查询当前用户名称

将 sudo chown -R apple:staff  中的apple 替换成查询出的用户名,运行该命令;

例如我的设备查出来的名称为 sant

在终端中执行

sudo chown -R sant(你设备的当前用户名称):staff

待指令运行结束,继续后面的操作。

 

附 homebrew常用操作:

brew install xxx           安装xxx

brew uninstall xxx       卸载xxx

brew update  xxx         更新xxx

brew doctor                 修复brew

原文链接:https://blog.csdn.net/auccy/article/details/54620454

相关文章

最近做自动化测试时,深感自己对前端涉猎太少,加上对这块比...
homebrew本身就是一个git仓库。使用homebrew安装软件包时,会...
一、Homebrew安装、卸载等命令Homebrew的安装和卸载都非常简...
在mac系统中,使用homebrew可以很方便的管理包。按照官网的说...
我按照说明从这里使用brew安装mysqlhttps://gist.github.com...
我在macOS10.12.4上安装了nginx1.10.3和php5.5.38作为开发服...