1

更新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).

带来不便敬请谅解!

4

2 回答 2

2

更新时收到与 OP 相同的错误homebrew。这是我解决它的方法:

故障排除:

与浅克隆相关的“错误”实际上是 GitHub 对 Homebrew 施加的更改:

" update.sh: 拒绝更新浅层自制核心/木桶克隆。#9383 "

https://github.com/Homebrew/brew/pull/9383

所以这个“错误”是故意抛出的,以迫使用户停止使用浅克隆——它与 OSX 到大约同时推出的“ Big Sur ”的任何升级无关。

解析度:

我只是按照“错误”消息中的指导进行操作,并且brew updatebrew upgrade工作:

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow

注意:当我在自己的 Big Sur 机器上进行brew 更新/升级时,我使用的是最新版本的 Xcode- 12.3如果您的brew 更新/升级仍然失败,这是brew config的输出,用于比较分析:

HOMEBREW_VERSION: 2.7.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: fdb71a5cb3029da2ef74d7e09c40575bbfb4ec72
Last commit: 9 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9b85587e2fa7dc1e46f50572ecf1e951613d7e21
Core tap last commit: 29 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.3 => 
/usr/local/Homebrew/Library/Homebrew/vendor/portable- ruby/2.6.3_2/bin/ruby
CPU: dodeca-core 64-bit kabylake
Clang: 12.0 build 1200
Git: 2.24.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.1-x86_64
CLT: 11.0.33.12
Xcode: 12.3
于 2021-01-06T10:16:38.653 回答
1

您是要安装 Homebrew 还是运行 brew 更新?在我的情况下,前者工作得很好,但后来我得到了同样的错误。运行 git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow 我收到错误:错误:RPC 失败;curl 18 传输关闭,未完成的读取数据仍然致命:协议错误:错误的包标头

谢谢, 亚历山大

于 2020-12-30T17:06:53.753 回答