brew: Brew requires linking before installing packages and never works

Bug reports:

The only step that resolves the issue is removing the affected linked packages and installing the desired package.

For example:

brew install php56           
Updating Homebrew...
==> Installing php56 from homebrew/php
Error: You must `brew link jpeg unixodbc` before homebrew/php/php56 can be installed

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 57 (31 by maintainers)

Most upvoted comments

OK, good.

brew list | while read f; do brew unlink $f; done
brew prune
brew list | while read f; do brew link --overwrite $f; done

Try first doing

sudo chown -R $(whoami) /usr/local/*

and then

brew list | while read f; do brew unlink $f; brew link $f; done