Skip to content

Installation keeps on failing if originally attempted at broken state #766

Open
@xeruf

Description

brew doctor output

--

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

--

What were you trying to do (and why)?

A friend had been trying to install brew, and apparently ended up stuck in Homebrew/brew#13865
He had tried rerunning the installation script over months, not knowing he had to reset it.

What happened (include all command output)?

The installation got stuck and had to be aborted:

% /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/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R USER:admin /opt/homebrew
==> Downloading and installing Homebrew...
HEAD is now at e191b827c Merge pull request Homebrew/brew#15257 from Bo98/download-refactor
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>...]'
^Cfatal: fetch-pack: invalid index-pack output
fetch-pack: unexpected disconnect while reading sideband packet
Failed during: /opt/homebrew/bin/brew update --force --quiet

What did you expect to happen?

Homebrew auto-corrects the broken installation attempt, maybe simply re-cloning the repository (we ran rm -rf /opt/homebrew and could then finalize the installation).
For simple-minded brew users the inability to figure out that fix might prevent them from using brew altogether.

Step-by-step reproduction instructions (by running brew commands)

Run an old installer and then the new one.
Should be something like below, but this works at least on Linux, so I don't know what the exact origin of the issue was:

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions