Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoiding "Another active Homebrew update process is already in progress"

Tags:

git

homebrew

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?

like image 707
orome Avatar asked Apr 16 '17 11:04

orome


People also ask

How do I stop homebrew from updating?

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.

How long does homebrew update take?

From 20 minutes to an hour. The devs are aware.


1 Answers

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.

like image 159
Aslan Varoqua Avatar answered Nov 09 '22 15:11

Aslan Varoqua