brew: MBP M1 fails to 'brew update' and 'brew upgrade'
Bug report
Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.
- ran
brew updateand can still reproduce the problem? - ran
brew doctor, fixed all issues and can still reproduce the problem? - ran
brew configandbrew doctorand included their output with your issue?
What you were trying to do (and why)
Every time i try to install with brew install something it gives me the following warning and error. When i try to update or upgrade it gave me only the warning and the error. Trying ‘brew install git’ or ‘brew reinstall git’ doesn’t solved.
What happened (include command output)
brew upgrade (the same output with brew update) fails with this warning and error.
alberto@MacBook-Pro ~ % brew upgrade Warning: git 2.30.0 is already installed and up-to-date To reinstall 2.30.0, runbrew reinstall git/opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6334 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6342 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6343 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6361 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6362 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6380 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6381 Killed: 9 "$GIT_EXECUTABLE" "$@" ==> Homebrew has enabled anonymous aggregate formula and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics No analytics have been recorded yet (or will be during thisbrew` run).
Error: Failure while executing; git config --replace-all homebrew.analyticsmessage true was terminated by uncaught signal KILL.
`
Command output
`alberto@MacBook-Pro ~ % brew update Warning: git 2.30.0 is already installed and up-to-date To reinstall 2.30.0, run `brew reinstall git` /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6947 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6963 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6975 Killed: 9 "$GIT_EXECUTABLE" "$@" Error: Fetching /opt/homebrew failed! Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-cask failed! Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-core failed! /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6986 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6994 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 6995 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 7013 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 7014 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 7032 Killed: 9 "$GIT_EXECUTABLE" "$@" /opt/homebrew/Library/Homebrew/cmd/update.sh: line 18: 7033 Killed: 9 "$GIT_EXECUTABLE" "$@" ==> Homebrew has enabled anonymous aggregate formula and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics No analytics have been recorded yet (or will be during this `brew` run).Error: Failure while executing;
git config --replace-all homebrew.analyticsmessage truewas terminated by uncaught signal KILL. `
What you expected to happen
I expect it updates and upgrade what i have installed 😅
Step-by-step reproduction instructions (by running brew commands)
brew update or brew upgrade on apple silicon macbook pro (the same error is given with brew install but the installation goes fine)
Output of brew config and brew doctor commands
alberto@MacBook-Pro ~ % brew config HOMEBREW_VERSION: >=2.5.0 (shallow or no git repository) ORIGIN: (none) HEAD: (none) Last commit: never Core tap ORIGIN: (none) Core tap HEAD: (none) Core tap last commit: never Core tap branch: (none) HOMEBREW_PREFIX: /opt/homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_MAKE_JOBS: 8 Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: octa-core 64-bit arm_firestorm_icestorm Clang: 12.0 build 1200 Git: N/A Curl: 7.64.1 => /usr/bin/curl macOS: 11.1-arm64 CLT: 12.3.0.0.1.1607026830 Xcode: 12.3 Rosetta 2: false alberto@MacBook-Pro ~ % brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: Git could not be found in your PATH. Homebrew uses Git for several internal functions, and some formulae use Git checkouts instead of stable tarballs. You may want to install Git: brew install git
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 8
- Comments: 85 (38 by maintainers)
Your Homebrew-installed
gitis probably broken. This seems to have come up a bunch of times, but I have no idea how it happens.Please read the following message before trying the steps below
Please make a note of the steps you took to encounter this problem, and the output of
brew configandbrew doctor. Then, share that information with us in this issue if the steps below fix it for you. Thanks!Do
and let me know if that helps.
Simple fix that worked for me after upgrading to 11.2 on an M1:
xcode-select --installwhich gitreturns/opt/homebrew/bin/gitbut it doesn’t workbrew uninstall gitwhich gitreturns/usr/bin/gitandgit --versionreturnsgit version 2.24.3 (Apple Git-128)brew updatebrew doctorreturnsYour system is ready to brew.Seems to be working.gitat this point. Does it matter?I was having the same issue after I upgraded to Big Sur 11.2 The above fixed it for me
Do
then try reinstalling
git. See also https://github.com/Homebrew/discussions/discussions/439.Every Big Sur update deletes most of my CLT (I do not have Xcode installed on this machine). That breaks brew update etc.
I reinstalled CLT, and everything works again.
Hey! I’m having this issue today on a fresh M1 Macbook Air.
What I’ve done:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Reading through the terminal logs it seems:
Tapping homebrew/corestarts but hits an errorOutput from there:
Running
git versiongives version 2.24.3Running
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"again gives this output:Yes that seems to work
A clean install works for me
Great, this works for me. I managed to fix the git
I’m guessing the problem comes from doing
brew install gitbefore runningbrew updateafter a freshbrewinstall using the standard installer.Doing this (i.e.
brew install gitwithoutbrew update) installs an old, broken version ofgit, which is evidenced by the output ofbrew configin the first post of this issue and in https://github.com/Homebrew/discussions/discussions/439#discussioncomment-261027. This shouldn’t be happening, sincebrew install, by default, should dobrew updatebefore anything else.Right now the way to avoid this seems to be to
brew updatemanually beforebrew install git, but you shouldn’t have to do that.To clarify, the sequence of events was:
brew install gitWhich resulted in a broken git installation in /opt/homebrew. I had to
brew uninstall gitto be able to do anything else with git (and pretty much everything I do depends on it).The git issue happened for me on a completely fresh install of homebrew and git on a brand new M1 Mac mini. It was literally one of the first things I did on this computer and the git install was immediately broken. I didn’t even do a
brew updatebefore the issues started, much less any upgrades. Perhaps it’s an issue with how one of the dependent libraries is getting bootstrapped on first install?Sorry, i tried to paste everything correctly but it does in one line (i’m not confident with markdown 😅). In the terminal everything is correctly spaced
Try
then reinstall
neovim. It also has a bottle now, so you shouldn’t need to be building it from source if you just want the latest stable release.I suggest taking your case to https://github.com/Homebrew/discussions/discussions. You have a
date-3.1.1still there which is causing issues. Post the output ofgem listwhen you create a thread.#10533 has been merged and will be a part of Homebrew 3.0.1. This should hopefully prevent some scenarios that resulted in systems getting into this broken
gitstate. The change enforces that you have development tools installed (Xcode or CLT) on Apple Silicon.Notably, it helps prevent the scenario where if you run
brew install gitorbrew upgradewithout development tools installed (Xcode or CLT) then you may be left with broken binaries. I believe this may have been why some people had issues updating to 11.2 - the update deletes the CLT and thus a subsequentbrew upgradecould have broken your installation.This will not fix systems already in a broken state. The aforementioned fix is the way to repair your installation.
@kingkool68, I think yours is actually a different, unrelated issue, but thanks very much for providing the debug information. (It’s actually how I could tell the issue is different.)
I believe I have this issue and before I go about fixing it here is the output of
brew config:and
brew doctorI did just install Bug Sur 11.2 last night. I tried to figure out what version of xcode tools I have installed by running this:
The steps mentioned in https://github.com/Homebrew/brew/issues/10275#issuecomment-757351887 worked for me!
I have a brand new m1 air on 11.2 - it has no rosetta, brew, Xcode, etc installed at all.
If you want to provide a step-by-step you’d like following/reporting back on, I’d be happy to follow it.
@AlbertoPimpo any luck with that repro? It seems this is affecting lots of users, but we currently have no idea how to fix it.
Now it works, thanks. Congrats for the amazing project and thanks for the responsiveness, it’s really incredible. If you need some telemetry for the error let me know.