homebrew 更新报错 homebrew-core is a shallow clone.

问题

19款mbp16更新到ventura之后就没管过homebrew,今天执行update报错

brew update
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
fatal: dumb http transport does not support shallow capabilities
~  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
remote: Enumerating objects: 401369, done.
remote: Counting objects: 100% (401359/401359), done.
remote: Compressing objects: 100% (122055/122055), done.
remote: Total 393989 (delta 282380), reused 382929 (delta 271367), pack-reused 0
Receiving objects: 100% (393989/393989), 167.04 MiB | 7.64 MiB/s, done.
Resolving deltas: 100% (282380/282380), completed with 5232 local objects.
From https://github.com/Homebrew/homebrew-cask
  6f2982f629f..62ca9d62d72  master     -> origin/master

解决

最后在一篇文章下找到了解决方案,其实他的做法也是修改源,但是成功了,做个记录,为自己和他人提供一个解决思路,操作如下

 ~  cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core   master  git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core   master  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
remote: Enumerating objects: 387770, done.
remote: Counting objects: 100% (358027/358027), done.
remote: Compressing objects: 100% (147642/147642), done.
remote: Total 350964 (delta 203097), reused 347396 (delta 200519), pack-reused 0
Receiving objects: 100% (350964/350964), 120.16 MiB | 10.92 MiB/s, done.
Resolving deltas: 100% (203097/203097), completed with 1503 local objects.
From https://mirrors.ustc.edu.cn/homebrew-core
   d5cb1375b81..6e79ffce447  master     -> origin/master

参考文章:
MacOS下PHP7.1升级到PHP7.4.15的方法

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值