Mac homebrew报错Error: homebrew-core is a shallow clone.

Mac homebrew报错Error: homebrew-core is a shallow clone.

解决方法

删除homebrew-core后更新即可

cd /usr/local/Homebrew/Library/Taps/homebrew
rm -rf homebrew-core
brew upgrade

使用brew upgrade后会重新更新homebrew-core

问题解析

Mac更新完系统后使用homebrew就报错:

Error:
  homebrew-core is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This restriction has been made on GitHub's request because updating shallow 
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!

链接: 参考

又出现问题了!!
当使用brew upgrade更新时出现如下错误提示:

Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.

问题解决

终端输入该语句,来代替brew upgrade
输入该语句的目录是/usr/local/Homebrew/Library/Taps/homebrew
注意:因为删掉了homebrew目录下homebrew-core,所以再新建一个该目录,mkdir homebrew 然后再输入如下语句

git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

成功后出现如下代码

Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 5748, done.
remote: Counting objects: 100% (5748/5748), done.
remote: Compressing objects: 100% (5507/5507), done.
remote: Total 5748 (delta 52), reused 380 (delta 17), pack-reused 0
Receiving objects: 100% (5748/5748), 5.24 MiB | 57.00 KiB/s, done.
Resolving deltas: 100% (52/52), done.

验证brew是否下载成功

重开一个终端输入 brew,出现如下代码说明已成功!

Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA

Contributing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh

走到这里可太不容易了!终于在mac 中下载好 brew~~
开始用brew 更新软件啦 开心开心~~

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值