How to fix `brew doctor` errors on Mac OSX 10.9 (unlinked kegs in Cellar and Homebrew sbin not found)?

血红的双手。 提交于 2019-12-05 08:31:42

The general problem here is that autoconf and libevent are already installed on your system, and they are in your homebrew "Cellar" as well. Thus there are TWO copies of autoconf on your system, and TWO copies of libevent on your system.

What homebrew is trying to do is delete the previously install (system wide) version of these libraries, and replace all the relevant REAL files with symlinks from the homebrew Cellar. That would give homebrew full control over upgrading and managing these libraries for you. It would also give you just one copy of these libraries available in two places.

The problem is that homebrew doesn't have unix permissions to delete these REAL files, and you'll need to do it yourself. Here's how for autoconf:

$ sudo rm /usr/local/share/emacs/site-lisp/autotest-mode.elc
$ sudo chmod 777 /usr/local/share/emacs/site-lisp/
$ sudo rm -rf /usr/local/share/autoconf
$ brew link --overwrite autoconf

You should see:

Linking /usr/local/Cellar/autoconf/2.69... 21 symlinks created

UPDATE I just noticed the part about sbin. I'm not sure how this problem happened originally, but I can explain how to fix it.

The fix recommended by homebrew (ECHO ...) only takes effect when you next login to your Mac. To have this change take effect now, you have to force your terminal to re-read the .bash_profile file. Just $ source ~/.bash_profile after you run the ECHO command provided by homebrew.

Since this question is a few months old now, you probably already discovered that this error message has gone away.

Run the following commands to grant the privileges:

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

Once the privileges are granted, now they have to be just linked since it is already installed:

$ brew link autoconf
$ brew link libevent

You may want to change writing permissions with chmod on /usr/local/share/emacs/site-lisp/autotest-mode.elc

After that you should get something like this: Linking /usr/local/Cellar/autoconf/2.69... 21 symlinks created

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!