Solvedbrew 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 update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew config and brew doctor and 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 true was 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

46 Answers

โœ”๏ธAccepted Answer

Your Homebrew-installed git is 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 config and brew doctor. Then, share that information with us in this issue if the steps below fix it for you. Thanks!


Do

brew uninstall git
brew update
brew reinstall pcre2 gettext
brew install git

and let me know if that helps.

More Issues: