29

How do you fix this?

$ brew doctor
...
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built.

    imagemagick
    jasper
    libtiff
    little-cms
...
Meltemi
  • 1,856
  • 3
  • 22
  • 26
  • For future users -> this is automated script http://apple.stackexchange.com/a/125319/53973 – jeet.chanchawat Mar 13 '16 at 05:52
  • It would be nice to understand why this typically happens. For software installations managed 100% through brew, how do kegs become unlinked in the first place? – jarmod Sep 07 '22 at 15:49

3 Answers3

25

Like this, for each unlinked keg:

brew link imagemagick

If you don't want to keep them, brew cleanup should get rid of them.

Synchro
  • 609
  • 7
    What if I have removed those 'kegs' previously? Why are they still there? I don't want to 'link' them again, I want to get rid of them. – Peter Štibraný Jan 08 '13 at 21:30
  • 9
    brew cleanup will get rid of unused stuff – Adam Nelson Oct 25 '13 at 09:25
  • @PeterŠtibraný I also didn’t want to link to the unlinked version of something I already had via brew (no idea) so brew cleanup then brew upgrade and another (possibly excessive tidying) `brew cleanup worked for me. – Dave Everitt Aug 02 '23 at 10:56
6

i ran below command and the problem is gone...

"brew upgrade"

sh6210
  • 161
4
brew link --overwrite imagemagick

repeat it for each and it will solve the issue