4

I was trying to re-install homebrew on my Mac. I used the following command.

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

I got the following error. Could someone help me with what to do here?

==> Checking for `sudo` access (which may request your password).
Password:
==> 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 -R aryan:admin /usr/local/Homebrew
==> Downloading and installing Homebrew...
HEAD is now at 227445ece Merge pull request #11288 from Homebrew/update-manpage
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
Failed during: /usr/local/bin/brew update --force --quiet
6
  • 1
    Homebrew's page uses the following: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    – agarza
    Apr 29, 2021 at 21:00
  • So, I updated the re-installed the "xcode-select install" and then tried running the command. But I am getting the same error. Apr 29, 2021 at 21:00
  • @agarza I just tried that too. I got the same error exactly. I just tried brew update-reset. that command points to master itself. So am I missing something here? Apr 29, 2021 at 21:02
  • 2
    Have you tried uninstalling first?
    – JBallin
    Apr 29, 2021 at 23:00
  • @JBallin I ran the command /bin/bash -c "$(curl -fsSL raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)" and it was uninstalled. As I mentioned in my previous comment, I removed the HomeBrew files from /usr/local and it is all good. May 1, 2021 at 0:14

2 Answers 2

12

I removed the HomeBrew files by running the following command. After that, I ran the installation as mentioned in the above post. It all worked fine. I was able to install all the packages I need.

# Intel systems
sudo rm -rf /usr/local/homebrew

# M1/M2 system
sudo rm -rf /opt/homebrew
1
3

I faced the same problem. The solution is just to remove your git configuration from your mac.

Command:

rm -rf ~/.gitconfig

After executing the command try to install brew. Command:

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

After installing homebrew install the brew git command:

brew install git

then configure your GitHub profile.

3
  • Welcome to Ask Different. Thanks for the answer. What does configure GitHub profile involve. Will homebrew not work?
    – bmike
    Mar 24 at 18:10
  • Thanks for the reply. Sure, the homebrew will work. But in my case, I miss configured my GitHub profile, I set my git repo to inside a local folder in my mac. So when I run the install command of brew then it's throwing me an error that homebrews default but does not exist. If your Girhub profile is already configured globally, then it's okay.
    – Paroi
    Mar 28 at 4:35
  • Adding that to the answer would be super if you wanted to elaborate - thanks so much for replying!
    – bmike
    Mar 28 at 13:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .