MACOS上的BREW安装失败,“没有有效的Ref:Refs/Refs/Enforts/Origin/Master”?
2021-01-22
1972
请帮我找到此错误的解决方案。我正在使用此命令安装 brew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
结果:
==> You are using macOS 10.13.
==> We (and Apple) do not provide support for this old version.
This installation may not succeed.
After installation, you will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew\'s GitHub,
Twitter or IRC. You are responsible for resolving any issues you experience
while you are running this old version.
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /usr/sbin/chown biad:admin /usr/local/Homebrew
==> Downloading and installing Homebrew...
HEAD is now at 3c84e1fef Merge pull request #10381 from jonchang/fix-version-type
error: Not a valid ref: refs/remotes/origin/master
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
fatal: Needed a single revision
invalid upstream 'origin/master'
Failed during: /usr/local/bin/brew update --force --quiet
2个回答
您似乎正在尝试覆盖核心分接已损坏的现有安装。请尝试删除 homebrew 核心文件夹,如下所示:
rm -fr $(brew --repo homebrew/core)
然后使用以下命令重新安装 homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
希望这对您有用。
iykethe1st
2022-10-14
这通常是由于 homebrew/core 中的某些内容损坏而发生的。
% find /opt/homebrew /usr/local/ -type d -name homebrew-core -print
% rm -rf the-directories-found-in-the-above-find
% brew tap homebrew/core
首先找到您的
homebrew-core
,然后删除 (
rm -rf
),然后重新安装。如果由于安装的内容不足以使
brew
正常工作而失败,则删除目录并重试初始安装。
James Risner
2022-09-24