【问题标题】:Homebrew Update Fails: fatal: protocol error: bad pack header on git fetchHomebrew 更新失败:致命:协议错误:git fetch 上的错误包标头
【发布时间】:2021-06-08 04:40:01
【问题描述】:

当我尝试更新(或升级 brew)时,我收到以下错误:

#> brew update
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 command may take a few minutes to run due to the large size of the repository.
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!

当我运行指示的命令时,我得到另一个错误:

#> git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
fatal: protocol error: bad pack header

我使用的是 macOS Big Sur V11.2.3。我有 BitDefender 作为防病毒软件。我尝试禁用它并运行上面的命令,但没有运气。任何帮助将不胜感激。

【问题讨论】:

    标签: git macos homebrew fatal-error


    【解决方案1】:

    我发现一些页面表明这是由我的 ISP(英国的 Virgin Media)启用的“防病毒”软件设置引起的。我在https://my.virginmedia.com/my-apps/onlinesecurity/websafe/settings 关闭了“病毒安全”,但这并没有解决我的问题。

    然后,我打开了我的 VPN (NordVPN),导致问题的 brew 命令起作用了。

    【讨论】:

    • 这解决了我的问题。我可能永远不会想到启用 VPN 来解决这个问题。
    • 谢谢。令人难以置信的是,这正在发生。就我而言,我不需要 VPN。我关闭了病毒安全和儿童安全,它工作。
    • 是的,这也是为我做的——非常感谢。我的 ISP 是talktalk(英国)。我只是关闭了所有家庭安全功能。像 @JimBob 我不需要 VPN 步骤。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-11-13
    • 1970-01-01
    • 2014-04-14
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 2019-07-07
    相关资源
    最近更新 更多