Brew upgrade get stuck in `removing...`


It’s been several times that this happen when I run a brew upgrade… in the last package that has to upgrade brew get stuck in Removing... message. Some times it takes a quite sometime and it finally continues —in other words, return to the prompt since this is the last action— but some others I need to hit ctrl+c because it stay there for perhaps an hour or more.

As you can see in the image, while brew sit on there, Ruby is usually using 100% of one of the CPUs of my machine. I’m under High Sierra.

This isn’t something new. I have been experiencing this behavior for a couple of months or perhaps more, but I wasn’t sure what was going on… and I also thought that it was just a temporal glitch.

Any idea of what is going on?

Thank you!

PS/ I haven’t fill an issue because I don’t know if it’s really reproducible or not.

Try to run brew cleanup --verbose --debug manually and see if it produces the same behaviour.

No, it ended well and quite fast.

PS/ I usually perform a brew cleanup after each brew upgrade and usually here is no issue.

Best bet is to run brew upgrade --debug next time and try to figure out where it’s stuck.


I’ll do that form now so see what is going on.


As of 2.0 this isn’t needed anymore. Cleanup will be done by default.

1 Like

BRAVO! :clap: :stuck_out_tongue:

it seems to get stuck here:

==> Summary
🍺  /usr/local/Cellar/wxpython/4.0.6: 1,130 files, 57.2MB
Removing: /usr/local/Cellar/wxpython/ (1,108 files, 37.9MB)
find /usr/local/Cellar/wxpython -name .DS_Store -delete
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cairo.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/r.rb

I don’t really know what is going on… those two formulae (cairo and r) are installed from another tap instead from core and they have the same name.

Could you try to untap that tap or uninstall those formulae?

Hardly no… because I need it. But I think I have a theory about what could be the issue at least in origin.

I have some other formulae that depends in R and therefore Cairo, but the Core ones instead of the ones from this tap. Since I don’t want to uninstall and install when the dependents are updated, I just unlink those cellars —R & cairo— and rename them. Brew installs the ones from core and after the install finish I just unlink the ones form core, delete them and the ones from the alternative tap and renamed back.

I’ll do a proper uninstall and install and let’s see how it turns out.

It’s still getting more or less stuck in that step:

Changing install name in /usr/local/Cellar/harfbuzz/2.5.1/lib/libharfbuzz.0.dylib
  from @@HOMEBREW_PREFIX@@/opt/graphite2/lib/libgraphite2.3.dylib
    to /usr/local/opt/graphite2/lib/libgraphite2.3.dylib
/usr/local/Homebrew/Library/Homebrew/postinstall.rb (Formulary::FromPathLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/harfbuzz.rb
🍺  /usr/local/Cellar/harfbuzz/2.5.1: 151 files, 10.0MB
Removing: /usr/local/Cellar/harfbuzz/2.5.0... (150 files, 10.0MB)
find /usr/local/Cellar/harfbuzz -name .DS_Store -delete
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/r.rb

I really don’t understand why it’s loading a formulae from core that aren’t installed in that step.

I tried to brew rm homebrew/core/r homebrew/core/cairo and it delete the ones from the other tap. I checked that no r or cairo formulae was installed and installed again the ones from the tap.

This is the tap of that formulae

This is still happening almost every time I brew upgrade. Any idea? @srfore is the maintainer of the alternative tap for R and Cairo. Is this happening to you? Any idea what is going on here?

By the way… not it’s stuck in here and no R or Cairo related message.

Next week I’m going to change my computer and upgrade to Mojave, perhaps is something related with the last version Ruby and High Sierra?

At this point it’s probably worth adding more debugging information to your local installations of Homebrew and the formulae to figure out what’s going on.

Yes, this happens to me intermittently as well. I’ve no idea what is causing it and cannot systematically reproduce the problem. Moreover, I am running Mojave so it is unlikely OS related.

In terms of additional information, I currently have the Homebrew cask version of R installed for all personal related use as well as the Homebrew core versions of R and Cairo installed (not the versions maintained at due to external formula dependencies.

The only reason I’m using the cask R version rather than my own or the core version is due to a quartz graphics related issue where fonts and lines get blurred upon resizing the plotting device. I have no idea if others have had this issue or it in any way relates to the subject at hand.

In short, I don’t know if brew upgrade hangs due to an issue with my tap or multiple versions of R being installed or something else entirely.

Also, just so you all know, I am no expert in any of this so it certainly could relate to my tap. If there are problems or other ways it could be improved to integrate better with other Homebrew formulas, I’d be happy implement them to the extent my skill allows!

1 Like

Definitely smells R and/or Cairo related.