Mac brew – how to relink installed binaries for a package

When brew installs a package, it also links the binary commands to brew prefix location. In case you have installed a package and for reason linking did not happen properly, you can relink the package. Here are steps to do brew relink for package imagamagick.

brew – unlinking a package

First run the following to unlink imagamagick.

$ brew unlink imagemagick
Unlinking /usr/local/Cellar/imagemagick/6.9.2-7... 72 symlinks removed

brew – linking a package

  1. Run the following to link imagamagick in dryrun mode. This will also list down what all will get linked.
    $ brew link imagemagick --dry-run
  2. To do actual linking run the following
    $ brew link imagemagick
    Linking /usr/local/Cellar/imagemagick/6.9.2-7... 71 symlinks created
  3. To see if link has been for created for one command (e.g. convert), run the following
    $ ls -l $(brew --prefix)/bin/convert

    Note that brew --prefix will list the brew prefix for installation.

Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit


Click here to write/view comments