I encounter this problem a lot, too. It always involves
installd, and most importantly, with
installd installing/updating Apple apps, like iWork (IIRC it's iWork exclusive; at least I've yet to encounter an occurrence with a third party app).
I believe it has nothing to do with iTerm2 or oh-my-zsh (although I use both, too). What I believe is that this is a shell compatibility issue — Apple's installer script calls your default shell, probably
$SHELL -c command...
It was tested on
bash but not
zsh, so when
zsh gets called this way, subtle shell compatibility issues arise. When you inspect the offending process (Activity Monitor unfortunately, AFAIK, doesn't show you the full commands; I use
htop for this, and you may well use
ps or whatever), you will see things like
zsh -c defaults delete com.apple.helpd com.apple.helpd.sdmMapsCreated
which backs my guess (well, my guess was actually derived from these observations, to be precise).* Therefore, the solution is simply run the command yourself, in this case
defaults delete com.apple.helpd com.apple.helpd.sdmMapsCreated
Then you kill the offending processes.
installd automatically moves on (probably to the next stuck process like this). After multiple rounds of grinding you'll find the installation finished successfully. I know this is annoying, but this is the only way I found to work (reliably).
* It is actually beyond me how
zsh -c gets stuck on things like
defaults delete. Not sure if it's with my environment. (I've put GNU coreutils and alike in front of BSD stuff in my PATH, but I'm pretty sure I never messed with
default internally use BSD utils? But again, I can run the same command in my terminal with zsh, either interactively or non-interactively, just fine. This is really baffling (the solution above is not affected). Any input is welcome.
I regularly have the same issue and it's always related to the installd process, updating an AppStore application. Killing first installd and then the zsh process helps (but disables the AppStore's functionality until it's restarted).