【问题标题】:Suspicious https://github.com/Homebrew/brew git origin remote found发现可疑的 https://github.com/Homebrew/brew git origin 远程
【发布时间】:2021-05-03 21:26:22
【问题描述】:

问题的症状如下:

 ~ % brew install htop
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> Updated Casks
Updated 2 casks.

==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "htop".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

无论我尝试安装什么都找不到。于是我跑了brew doctor

Warning: Suspicious https://github.com/Homebrew/homebrew-core git origin remote found.
The current git origin is:
  https://github.com/Homebrew/brew

With a non-standard origin, Homebrew won't update properly.
You can solve this by setting the origin remote:
  git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" remote set-url origin https://github.com/Homebrew/homebrew-core

紧随其后

git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" remote set-url origin https://github.com/Homebrew/homebrew-core

然后再次运行 brew doctor 并得到

Warning: Suspicious https://github.com/Homebrew/brew git origin remote found.
The current git origin is:
  https://github.com/Homebrew/homebrew-core

With a non-standard origin, Homebrew won't update properly.
You can solve this by setting the origin remote:
  git -C "/usr/local/Homebrew" remote set-url origin https://github.com/Homebrew/brew

于是我运行了命令git -C "/usr/local/Homebrew" remote set-url origin https://github.com/Homebrew/brew

然后再次运行 brew doctor 并得到第一个结果。

对可能出现的问题有什么想法吗?

【问题讨论】:

    标签: git macos homebrew


    【解决方案1】:

    我在全新安装自制软件时也遇到了上述错误。我做了以下操作并修复了警告:

    cd /usr/local/Homebrew/Library/Taps/homebrew/
    rm -rf homebrew-core
    git clone https://github.com/Homebrew/homebrew-core.git
    

    现在brew doctor 现在给出Your system is ready to brew

    希望这对你也有用!

    【讨论】:

    • 我还全新安装了 home brew,这也意味着全新安装了整个操作系统。我最终擦除了操作系统并重新安装,一切都已修复。现在,我希望这对其他人有所帮助。感谢您的贡献!
    • 这行得通,但我必须在 /opt/homebrew/Library/Taps/homebrew 而不是 /usr/local/... 中这样做
    猜你喜欢
    • 2021-07-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-08
    • 2021-09-09
    • 1970-01-01
    • 1970-01-01
    • 2019-07-10
    相关资源
    最近更新 更多