最新消息:20210917 已从crifan.com换到crifan.org

【已解决】Mac中brew install报错:Error homebrew-core is a shallow clone

brew crifan 2338浏览 0评论
折腾:
【未解决】gitbook安装和使用插件autocover给生成的pdf文件加上封面
期间,运行:
==> Downloading https://homebrew.bintray.com/bottles/libusb-1.0.24.mojave.bottle.tar.gz
###################                                                       27.1%^C
 ✘ xxx@xxx  ~/dev/crifan/gitbook/gitbook_template/books/gitbook_demo   master ●  brew install pkg-config cairo pango libpng jpeg giflib librsvg
结果:
Error: 
  homebrew-core is a shallow clone.
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
These commands may take a few minutes to run due to the large size of the repositories.
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!
Warning: pkg-config 0.29.2_3 is already installed and up-to-date
To reinstall 0.29.2_3, run `brew reinstall pkg-config`
Warning: cairo 1.16.0_4 is already installed and up-to-date
To reinstall 1.16.0_4, run `brew reinstall cairo`
Warning: pango 1.48.0 is already installed and up-to-date
To reinstall 1.48.0, run `brew reinstall pango`
Warning: libpng 1.6.37 is already installed and up-to-date
To reinstall 1.6.37, run `brew reinstall libpng`
Warning: jpeg 9d is already installed and up-to-date
To reinstall 9d, run `brew reinstall jpeg`
Warning: giflib 5.2.1 is already installed and up-to-date
To reinstall 5.2.1, run `brew reinstall giflib`
Warning: librsvg 2.50.2 is already installed and up-to-date
To reinstall 2.50.2, run `brew reinstall librsvg`
然后:
 brew upgrade jpeg
Error: 
  homebrew-core is a shallow clone.
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
These commands may take a few minutes to run due to the large size of the repositories.
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!
Warning: jpeg 9d already installed
同样报错。
运行:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
好像卡死了?
还是去解决:
mac error homebrew-core is a shallow clone
Cannot brew update or upgrade: Error: homebrew-cask is a shallow clone. · Issue #9420 · Homebrew/brew
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
Why is a full clone of homebrew/core required for brew update? · Discussion #226 · Homebrew/discussions
好像就是说要:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch —unshallow
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
有进展和输出了
 git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
remote: Enumerating objects: 52773, done.
remote: Counting objects: 100% (51190/51190), done.
remote: Compressing objects: 100% (16634/16634), done.
Receiving objects: 100% (46482/46482), 22.69 MiB | 219.00 KiB/s, done.
remote: Total 46482 (delta 34054), reused 42238 (delta 29839), pack-reused 0
Resolving deltas: 100% (34054/34054), completed with 2076 local objects.
结束了。
再去试试:
 brew upgrade jpeg
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!
Warning: jpeg 9d already installed
继续:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
等了好一会终于有进展了:
和:
最后失败了:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
remote: Enumerating objects: 654563, done.
remote: Counting objects: 100% (654515/654515), done.
remote: Compressing objects: 100% (223842/223842), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
再试试:
 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
remote: Enumerating objects: 654563, done.
remote: Counting objects: 100% (654515/654515), done.
remote: Compressing objects: 100% (223842/223842), done.
Receiving objects: 100% (645411/645411), 259.16 MiB | 208.00 KiB/s, done.
remote: Total 645411 (delta 424275), reused 639847 (delta 418716), pack-reused 0
Resolving deltas: 100% (424275/424275), completed with 4087 local objects.
From https://github.com/Homebrew/homebrew-core
   c3ee68e133..459f19f1a0 master     -> origin/master
等了1个多小时,终于结束了。
后续:
 brew upgrade jpeg
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 3 formulae.


Warning: jpeg 9d already installed
就正常了。
【总结】
此处之前由于一些原因,导致brew报错:
Error: 
  homebrew-core is a shallow clone.
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
These commands may take a few minutes to run due to the large size of the repositories.
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
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
即可。
注:
1.需要等待足够长时间,才可以。
2.如果速度慢,可以考虑加代理,比如:
export ALL_PROXY=socks5://127.0.0.1:51837

转载请注明:在路上 » 【已解决】Mac中brew install报错:Error homebrew-core is a shallow clone

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.187 seconds, using 23.38MB memory