I have a script I use for maintaining by Homebrew installation containing the line
brew --config && echo; brew update && echo; brew upgrade && brew list && echo; brew leaves && echo; brew cask list && echo;
and running (typically) in ~
. Occasionally when I run this script I get output that includes
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
followed by
Error: Another active Homebrew update process is already in progress.
Please wait for it to finish or terminate it to continue.
How do I prevent this from happening?
From reading the suggested help, I expect that running something like git gc --auto --aggressive &&
explicitly first would work, but it's unclear to me how to aim it at the right repo. Or is the cause something else entirely?
Save this answer. Show activity on this post. another possible solution is to send Ctrl-C to the shell while HomeBrew running brew update --auto-update . This will interrupt the updating process.
From 20 minutes to an hour. The devs are aware.
The active homebrew is usually from a lock file being stuck... you could try rm /usr/local/var/homebrew/locks/*
in script before the error or find specific offending lock and remove it. Also, you can find what is failing to remove it and why but more info would be needed. If something is running on another thread it's possible there is some race condition.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With