在 OSX Big Sur 上,我有一个非常令人沮丧的错误经历,因为所有解决方案都依赖于使用brew install
. 但是运行brew install
总是返回一个错误,例如:
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 失败了:
% git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/libexec/git-core/git-remote-https
Reason: image not found
最后,解决方案是重新安装git。
brew reinstall git
然后根据需要更新符号链接:
brew link --overwrite git