Homebrew:Mac OS 使用brew工具时报错No remote ‘origin’


使用 brew update 时报错:Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!

 

解决办法


1、 执行doctor检查程序

brew doctor
Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  php
  openssl@3

Warning: You have an unnecessary local Cask tap.
This can cause problems installing up-to-date casks.
Please remove it by running:
  brew untap homebrew/cask

Warning: You have an unnecessary local Core tap!
This can cause problems installing up-to-date formulae.
Please remove it by running:
 brew untap homebrew/core

 

2、然后按照doctor的指示进行操作

 brew link php

// 输出
Unlinking /opt/homebrew/Cellar/php@7.4/7.4.29... 25 symlinks removed.
Linking /opt/homebrew/Cellar/php/8.1.6... 24 symlinks created.

 

brew link  openssl@3

// 输出
Linking /opt/homebrew/Cellar/openssl@3/3.0.3... 5505 symlinks created.

 

brew untap homebrew/cask

// 输出
Untapping homebrew/cask...
==> Downloading https://formulae.brew.sh/api/cask.jws.json
##################################################################################################################################################################### 100.0%
Untapped 4269 casks (4,388 files, 1.3GB).

 

brew untap homebrew/core

// 输出
Untapping homebrew/core...
Untapped 3 commands and 6766 formulae (7,173 files, 1GB).

 

3、执行 brew update 

 

虽然能进行update了,但是还是有一个remote仓库连不上,报错 No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!。于是需要将homebrew-services也进行重装.

rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-services"

brew tap homebrew/services

//输出
==> Tapping homebrew/services
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 2488, done.
remote: Counting objects: 100% (241/241), done.
remote: Compressing objects: 100% (127/127), done.
remote: Total 2488 (delta 145), reused 135 (delta 113), pack-reused 2247
Receiving objects: 100% (2488/2488), 689.84 KiB | 1.95 MiB/s, done.
Resolving deltas: 100% (1145/1145), done.
Tapped 1 command (45 files, 859.6KB).

这时再执行 brew update 就正常了!

发布时间 : 2023-02-28,阅读量:2134
本文链接:https://upwqy.com/details/335.html
Homebrew 无法安装过时的PHP版本 Mac下更换Homebrew镜像源