Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
xeruf opened this issue Apr 28, 2023 · 2 comments
Open
3 tasks done

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

xeruf opened this issue Apr 28, 2023 · 2 comments

Comments

@xeruf
Copy link

xeruf commented Apr 28, 2023

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)
@xeruf xeruf added the bug label Apr 28, 2023
@carlocab carlocab transferred this issue from Homebrew/brew Apr 28, 2023
@MikeMcQuaid
Copy link
Member

Homebrew auto-corrects the broken installation attempt

I think this is a reasonable ask for this particular issue i.e. a partially failed clone.

@nowakwp

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@MikeMcQuaid @xeruf @nowakwp and others