Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix brew doctor errors?

Tags:

homebrew

I'm very much a newbie when it comes to all this so forgive my incompetence.

When I run brew Doctor, I get the following. Can someone help?

[/usr/local]$ brew doctor  Error: Setting DYLD_LIBRARY_PATH can break dynamic linking. You should probably unset it. Error: Some keg-only formula are linked into the Cellar. Linking a keg-only formula, such as gettext, into the cellar with brew link f will cause other formulae to detect them during the ./configure step. This may cause problems when compiling those other formulae.  Binaries provided by keg-only formulae may override system binaries with other strange results.  You may wish to brew unlink these brews:  libxml2  Error: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.  Unexpected dylibs: /usr/local/lib/libcharset.1.dylib /usr/local/lib/libfreetype.6.dylib /usr/local/lib/libjpeg.8.dylib /usr/local/lib/liblcms.1.0.19.dylib /usr/local/lib/libMagickCore.4.dylib /usr/local/lib/libMagickWand.4.dylib /usr/local/lib/libpng15.15.dylib /usr/local/lib/libtiff.3.dylib /usr/local/lib/libtiffxx.3.dylib /usr/local/lib/libwmf-0.2.7.1.0.dylib /usr/local/lib/libwmflite-0.2.7.0.1.dylib Error: Unbrewed .la files were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.  Unexpected .la files: /usr/local/lib/libcharset.la /usr/local/lib/libfreetype.la /usr/local/lib/libjpeg.la /usr/local/lib/liblcms.la /usr/local/lib/libMagickCore.la /usr/local/lib/libMagickWand.la /usr/local/lib/libpng15.la /usr/local/lib/libtiff.la /usr/local/lib/libtiffxx.la /usr/local/lib/libwmf.la /usr/local/lib/libwmflite.la Error: Unbrewed .pc files were found in /usr/local/lib/pkgconfig. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.  Unexpected .pc files: /usr/local/lib/pkgconfig/freetype2.pc /usr/local/lib/pkgconfig/ImageMagick.pc /usr/local/lib/pkgconfig/lcms.pc /usr/local/lib/pkgconfig/libpng15.pc /usr/local/lib/pkgconfig/MagickCore.pc /usr/local/lib/pkgconfig/MagickWand.pc /usr/local/lib/pkgconfig/Wand.pc Error: Unbrewed static libraries were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.  Unexpected static libraries: /usr/local/lib/libcharset.a /usr/local/lib/libfreetype.a /usr/local/lib/libjpeg.a /usr/local/lib/liblcms.a /usr/local/lib/libpng15.a /usr/local/lib/libtiff.a /usr/local/lib/libtiffxx.a /usr/local/lib/libwmf.a /usr/local/lib/libwmflite.a Error: You have uncommitted modifications to Homebrew's core. Unless you know what you are doing, you should run: cd /usr/local && git reset --hard Error: Some directories in your path end in a slash. Directories in your path should not end in a slash. This can break other doctor checks. The following directories should be edited: /usr/local/git/bin/ [/usr/local]$ 
like image 594
bradjenn Avatar asked May 14 '12 09:05

bradjenn


People also ask

What does Brew link overwrite do?

This is done automatically when you install formulae but can be useful for DIY installations. --overwrite : Delete files that already exist in the prefix while linking. -n , --dry-run : List files which would be linked or deleted by brew link --overwrite without actually linking or deleting any files.

What is brew Doctor Mac?

Brew Doctor is Homebrew's own self-diagnosis tool. Once this is done, you should run brew update in order to download new "formulae". Running Brew Update. Formulae are instructions for Homebrew on how to install specific software and where to find the necessary files and dependencies.

Where is homebrew installed on Mac?

On Mac Intel, Homebrew installs itself into the /usr/local/bin directory, which is already configured for access by the shell with the macOS default $PATH environment variable (the default is set by the /usr/libexec/path_helper command).


2 Answers

Error: Setting DYLD_LIBRARY_PATH can break dynamic linking. You should probably unset it. Error: Some keg-only formula are linked into the Cellar. Linking a keg-only formula, such as gettext, into the cellar with brew link f will cause other formulae to detect them during the ./configure step. This may cause problems when compiling those other formulae.  Binaries provided by keg-only formulae may override system binaries with other strange results. 

This is asking you to unset your Dynamic Loading Library Path. You can do this by finding out where you set it and removing it. Most likely, you have a line in your ~/.bashrc or ~/.bash_profile that looks like export DYLD_LIBRARY_PATH=/some/path:$DYLD_LIBRARY_PATH

You may wish to brew unlink these brews:  libxml2 

When Brew links, it's creating a symlink to the installation. It's how you can have python2.6. python2.7 installed but python will run one of them.

brew unlink libxml2

Error: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.  Unexpected dylibs: /usr/local/lib/libcharset.1.dylib /usr/local/lib/libfreetype.6.dylib /usr/local/lib/libjpeg.8.dylib /usr/local/lib/liblcms.1.0.19.dylib /usr/local/lib/libMagickCore.4.dylib /usr/local/lib/libMagickWand.4.dylib /usr/local/lib/libpng15.15.dylib /usr/local/lib/libtiff.3.dylib /usr/local/lib/libtiffxx.3.dylib /usr/local/lib/libwmf-0.2.7.1.0.dylib /usr/local/lib/libwmflite-0.2.7.0.1.dylib Error: Unbrewed .la files were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.  Unexpected .la files: /usr/local/lib/libcharset.la /usr/local/lib/libfreetype.la /usr/local/lib/libjpeg.la /usr/local/lib/liblcms.la /usr/local/lib/libMagickCore.la /usr/local/lib/libMagickWand.la /usr/local/lib/libpng15.la /usr/local/lib/libtiff.la /usr/local/lib/libtiffxx.la /usr/local/lib/libwmf.la /usr/local/lib/libwmflite.la Error: Unbrewed .pc files were found in /usr/local/lib/pkgconfig. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.  Unexpected .pc files: /usr/local/lib/pkgconfig/freetype2.pc /usr/local/lib/pkgconfig/ImageMagick.pc /usr/local/lib/pkgconfig/lcms.pc /usr/local/lib/pkgconfig/libpng15.pc /usr/local/lib/pkgconfig/MagickCore.pc /usr/local/lib/pkgconfig/MagickWand.pc /usr/local/lib/pkgconfig/Wand.pc Error: Unbrewed static libraries were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted.  Unexpected static libraries: /usr/local/lib/libcharset.a /usr/local/lib/libfreetype.a /usr/local/lib/libjpeg.a /usr/local/lib/liblcms.a /usr/local/lib/libpng15.a /usr/local/lib/libtiff.a /usr/local/lib/libtiffxx.a /usr/local/lib/libwmf.a /usr/local/lib/libwmflite.a  

These are residual files from other installations. You can delete them.

rm FILENAME

Error: You have uncommitted modifications to Homebrew's core. Unless you know what you are doing, you should run: cd /usr/local && git reset --hard  

Here, it is telling you that you made modifications to Homebrew files. Luckily, Homebrew is stored in Git version control so you can revert those changes.

cd /usr/local && git reset --hard

Error: Some directories in your path end in a slash. Directories in your path should not end in a slash. This can break other doctor checks. The following directories should be edited: /usr/local/git/bin/  

The PATH variable is where your computer searches for programs when you type it in the command line. You can see your path with echo $PATH.

Standards dictate that all the paths in PATH should not end in a slash. Thus, homebrew is asking you to fix it.

nano ~/.bashrc or nano ~/.bash_profile and look for '/usr/local/git/bin/' and remove the trailing slash.

like image 106
Liyan Chang Avatar answered Sep 17 '22 16:09

Liyan Chang


I'm new to brew as well. When I first tried, I ended up with a laundry list of errors. Not all needed to be fixed for me to use brew as I needed it. In particular, I was able to ignore the

Unbrewed * were found in /usr/local/lib  

messages that I was getting. I believe those are only a problem when your use of brew installed packages will interfere with ones you've installed before (in my case, it was NTFS-3g, not related to my future uses of brew).

like image 37
mgojohn Avatar answered Sep 21 '22 16:09

mgojohn