I just discovered that on my MAC /usr/local/include is a symbolic link to usr/include (since about 9 months), causing problems with homebrew. I wonder whether this link is normal? harmless? Is there a way to disentangle that (make /usr/local/include an independent directory containing those files that belong there (which ones are that?) and keep the rest in /usr/include/)?

1 Answer 1


As you say it is a mess and there is no easy way to undo this as it is difficult to tell which ones were installed from which source.

The ones which should be in /usr/include come from OS X directly or Xcode and its command line tools.

So in theory you can identify which are Homebrew and which are not.

If you could then remove the /usr/local/include link mkdir a new /usr/local/include then mv the Homebrew items from /usr/include to the new dir. Then reinstall OS X and Xcode command line tools (the latter might be sufficient). However I think this is not going to be doable in practice. So delete the link and directory and reinstall OS X, Xcode command line tools and Homebrew.

If all your builds have /usr/local/include as the first include directory then you won't have any issues but that is ALL builds. (for example python builds that use C in setup should use the same includes python was built with so should use /usr/include)

  • The offending link pre-dated homebrew, which I only installed 3 days ago. So, I simply moved all links/files more recent than that to /usr/local/include. Didn't have to re-install OS X or Xcode. Do you think problems will persist? (if so, I could re-install homebrew).
    – Walter
    Commented Jun 29, 2015 at 16:46
  • I think you will be OK as you could id the Homebrew ones - I would however reinstall the Xcode command line tools as some Homebrew might have overwritten them (or restore /usr/include from a backup as you have a known point in time when the directory was good)
    – mmmmmm
    Commented Jun 29, 2015 at 17:30
  • Anyway there is a new Xcode today so install that and its command line tools
    – mmmmmm
    Commented Jun 30, 2015 at 19:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .