【问题标题】:Brew installation - not a valid reference errorBrew 安装 - 不是有效的参考错误
【发布时间】:2022-01-03 05:07:15
【问题描述】:

我正在尝试使用单行命令在 macos m1 芯片上安装自制软件,但一直遇到以下错误。有人可以帮我解决这个问题吗?谢谢。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew

Press RETURN to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R miththinda:admin /opt/homebrew
==> Downloading and installing Homebrew...
HEAD is now at a0ae4a7a0 Merge pull request #12658 from sjackman/sj/linkage-checker
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>...]'

【问题讨论】:

    标签: macos homebrew apple-m1


    【解决方案1】:

    删除目录并尝试重新安装对我有用。

    sudo rm -rf /opt/homebrew
    

    【讨论】:

      【解决方案2】:

      Mac 上遇到类似问题,我首先通过键入以下命令将其卸载,然后安装了 Xcode,运行 再次安装命令。

      ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
      

      【讨论】:

        【解决方案3】:

        我首先使用 homebrew 安装页面上推荐的命令将它安装到我的 Linux 系统上:

        /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
        

        但似乎需要很长时间,并“挂”显示输出:

        Resolving deltas: 100% (793706/793706), done.
        

        有一段时间了。然后我很不耐烦并终止了该过程,然后再次尝试安装。那是我收到OP报告的错误的时候。修复方法是卸载部分安装的自制软件,然后重新安装:

        /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
        /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
        

        【讨论】:

          猜你喜欢
          • 2022-07-08
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-05-02
          • 2014-09-08
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多