homebrew无法更新软件问题更新时报错Warning: No remote ‘origin‘ 的解决方案

brew --repo

查询目录进行修改

git -C "xxxxx" remote set-url origin https://github.com/Homebrew/brew
git -C "/usr/local/Homebrew" remote set-url origin https://github.com/Homebrew/brew

没有什么用
Error: Failure while executing; git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask --origin=origin --template= --config core.fsmonitor=false exited with 128

brew update

Warning: No remote ‘origin’ in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
更新服务试试

rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services"
brew tap homebrew/services
ok-one:~ fu$ brew tap homebrew/services
==> Downloading https://mirrors.cloud.tencent.com/homebrew-bottles/bottles/bottles-portable-ruby/portable-ruby-3.1.4.el_capitan.bottle.tar.gz
######################################################################### 100.0%
==> Pouring portable-ruby-3.1.4.el_capitan.bottle.tar.gz
==> Tapping homebrew/services
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 2583, done.
remote: Counting objects: 100% (2583/2583), done.
remote: Compressing objects: 100% (1143/1143), done.
remote: Total 2583 (delta 1256), reused 2520 (delta 1247), pack-reused 0
Receiving objects: 100% (2583/2583), 674.60 KiB | 150.00 KiB/s, done.
Resolving deltas: 100% (1256/1256), done.
Tapped 1 command (46 files, 859.7KB).

更新成功了

brew update
Error: Fetching /usr/local/Homebrew failed!

rm -rf “/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask”

brew tap homebrew/cask

rm -rf “/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core”

brew tap homebrew/core

搞不定

在终端单独开启一个窗口防止因为之前执行例如export的命令影响下面命令的执行 (很重要)

cd /usr/local/Homebrew/Library/Taps/homebrew
rm -rf homebrew-core 
rm -rf homebrew-cask

git地址没有用清华官网的,因为尝试以后还是拉不下来镜像

git clone https://mirrors.ustc.edu.cn/homebrew-core.git
git clone https://mirrors.ustc.edu.cn/homebrew-cask.git

最后执行

brew upgrage

还是有点小问题

brew update

error: RPC failed; curl 16 Error in the HTTP2 framing layer
fatal: expected flush after ref listing
Error: Fetching /usr/local/Homebrew failed!
Installing from the API is now the default behaviour

git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" 
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
brew update
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
brew tap buo/cask-upgrade
brew cu -f -a
=> Options
Include auto-update (-a): true
Include latest (-f): true
==> Updating Homebrew
Already up-to-date.
==> Finding outdated apps
     Cask                    Current  Latest  A/U    Result    
1/3  android-platform-tools  34.0.5   34.0.5       [   OK   ]  
2/3  docker                  2.4.0.0  4.26.0   Y   [ FORCED ]  
3/3  java                    13.0.1                [   OK   ]  
==> Found outdated apps
     Cask    Current  Latest  A/U    Result    
1/1  docker  2.4.0.0  4.26.0   Y   [ FORCED ]  

Do you want to upgrade 1 app or enter [i]nteractive mode [y/i/N]? n

ok-one:homebrew-core fu$ brew update
Already up-to-date.

参考文章
https://www.jianshu.com/p/bee56e756ece
https://www.jianshu.com/p/1e80cbc5a873
https://www.jianshu.com/p/7f7aa4aeb50a

  • 11
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值