Unable to fix homebrew install on mac [closed] - macos

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I've been trying on and off for the last couple of months to install homebrew on my mac and it is not working. I've tried deleting directories, installing and reinstalling homebrew and then not being able to install certain libraries like mongoosedb, I even reset my computer and the problem is still there.
This is the error message i recieve now when trying to reinstall homebrew.
==> Tapping homebrew/core
remote: Enumerating objects: 973663, done.
remote: Counting objects: 100% (340/340), done.
remote: Compressing objects: 100% (189/189), done.
error: 4292 bytes of body are still expected.67 MiB | 6.00 MiB/s
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: index-pack failed
Failed during: git fetch --force origin refs/heads/master:refs/remotes/origin/master
Any suggestions as too how I could fix this?
Thanks.

As stupid as it sounds, the problem was I had Child Block enabled on my virgin wifi.

I'd suggest a few ways, since home brew depends on cellar
Try doing
rm -f /usr/local/Cellar
rm -f /usr/local/.git
This will reset your git, but the moment you input a clone command, you can proceed after providing git credentials.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
If your have ruby setup
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Related

Error installing Homebrew "unexpected disconnect while reading sideband packet"

I tried installing Homebrew on the M1 Mac Mini using the command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
as it is on the docs.
Then mid-way got this error
==> Tapping homebrew/core
remote: Enumerating objects: 1107077, done.
remote: Counting objects: 100% (228/228), done.
remote: Compressing objects: 100% (157/157), done.
error: 545 bytes of body are still expected.44 MiB | 341.00 KiB/s
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: index-pack failed
Failed during: git fetch --force origin refs/heads/master:refs/remotes/origin/master
myuser~ %
This is more of github checkout issue rather than Homebrew issue, checkout this suggestion:
It might be your network issue. If the network is too slow, then it might disconnect connection unexpectedly.
If you are having a good internet and still getting this message then it might be an issue with post buffer. You can resolve it by executing the following command in your cmd.
git config --global http.postBuffer 157286400

In macOS, installing Homebrew from clean install returns an error

I'm trying to install brew on my mac (intel), I'm using this command (from the homepage of Brew https://brew.sh/):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
And it returns the following error:
==> 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 User:admin /usr/local/Homebrew
==> Downloading and installing Homebrew...
error: Could not read 02f0189335907805d422c817462674081f48ab60
error: Could not read 7e455a623a3f49f63b589ea31d72c860b1d33c06
error: Could not read 02f0189335907805d422c817462674081f48ab60
error: Could not read 7e455a623a3f49f63b589ea31d72c860b1d33c06
remote: Enumerating objects: 111915, done.
remote: Counting objects: 100% (107893/107893), done.
remote: Compressing objects: 100% (25395/25395), done.
remote: Total 107053 (delta 81151), reused 104985 (delta 79221), pack-reused 0
Receiving objects: 100% (107053/107053), 28.88 MiB | 6.37 MiB/s, done.
Resolving deltas: 99% (81133/81151), completed with 618 local objects.
fatal: pack has 18 unresolved deltas
fatal: index-pack failed
Failed during: git fetch --force origin
It doesn't give me any hint of possible follow-up actions. What should I do?
Let me know if I should post any additional information.
After hours of wandering around forums and GitHub issues, and StackOverflow answers long gone forgotten, I finally made it!
I solved it by removing my /usr/local/Homebrew folder and then reinstalling homebrew from scratch with the command from their website (https://brew.sh/).
Now, I would love to give credit to whom I got this solution from, but I can't find the link among all the tabs and docs I had open. Maybe one day...

stripe login zsh: command not found: stripe

I'm following stripes docs and when I go to stripe login in step 2, I get the following error:
zsh: command not found: stripe
I already performed step 1, installing the stripe CLI, Why am I getting this error?
Update, Update2: I performed the recommended actions, but stripe login still does not work.
I realized, that I am getting the following error for step 1: (Check update2)
nmaer#nmaer-MBP SignUpFlowFanclub % brew install stripe/stripe-cli/stripe
Error:
homebrew-core is a shallow clone.
To `brew update`, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2
==> Installing stripe from stripe/stripe-cli
==> Downloading https://github.com/stripe/stripe-cli/releases/download/v1.5.9/stripe_1.5.9_mac-os_x86_64.tar.gz
Already downloaded: /Users/nmaer/Library/Caches/Homebrew/downloads/afda22020bd67ba6a51e1c4420ec72f009db3462b48c7675b83b1fa0b77928af--stripe_1.5.9_mac-os_x86_64.tar.gz
Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2
Error: Your Command Line Tools (CLT) does not support macOS 11.
It is either outdated or was modified.
Please update your Command Line Tools (CLT) or delete it if no updates are available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Alternatively, manually download them from:
https://developer.apple.com/download/more/.
Error: An exception occurred within a child process:
SystemExit: exit
I re-installed homebrew by running:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then I ran brew install stripe/stripe-cli/stripe again, and this time it worked without any problems.
Maybe the answer is a bit late for you, but I also spent some time on it and share my solution to the problem.
You can also install Stripe without a package manager. On the new Mac with M1 chip there are problems with the path.
Download the latest release
https://github.com/stripe/stripe-cli/releases/tag/v1.7.13
Then move the unzipped file to the /usr/local/bin folder and you can use the stripe commands again

Brew install on macOS fails with "Not a valid ref: refs/remotes/origin/master"?

Please help me find a solution to this error. I am installing brew with this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
The result:
==> 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
It seems you are trying to overwrite an existing install that has a broken core tap. Try deleting the homebrew core folder like this:
rm -fr $(brew --repo homebrew/core)
Then reinstall homebrew using:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Hope this works for you.
This generally happens when something with homebrew/core is corrupt.
% find /opt/homebrew /usr/local/ -type d -name homebrew-core -print
% rm -rf the-directories-found-in-the-above-find
% brew tap homebrew/core
First find your homebrew-core, then remove (rm -rf), then reinstall. If this fails because it didn't install enough to get a working brew, then remove the directory and retry the initial install.

Homebrew failing to install - fatal: not in a git directory

I'm trying to install homebrew on a macOS and I'm failing with the following message:
h
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
fatal: not in a git directory
Failed during: git config --replace-all homebrew.analyticsmessage true
Any ideas of what it could be and how to fix it? Many thanks (:
sudo rm -rf /usr/local/Homebrew
to remove everything before you landed here ;) and then run
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
I hope it helps.
Can you run the following commands to see if it helps?
$ cd `brew --prefix`
$ git remote add origin https://github.com/Homebrew/homebrew.git
$ git fetch origin
$ git reset --hard origin/master
$ brew update
Already up-to-date.
Also it would be helpful if you can attach brew doctor and brew config in the original post. Thanks!
I had a similar problem, running this command; "/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
I got this log;
=> /usr/bin/sudo /bin/chmod u+rwx /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> Downloading and installing Homebrew...
/usr/local/homebrew/.git: Permission denied
I gave permission to /user/local/homebrew and now I can test with brew....

Resources