Homebrewの問題をチェックしてくれる
brew doctor
コマンド。
Homebreを使い続けていると整合性の問題などが発生し
Warningが山のように出力される事態に。
何も問題が無い場合はdoctorコマンドを実行すると
Your system is ready to brew.
と出力されます。
今回はbrew doctorコマンドを実行した時に出力される
Warning毎に,その解決策をアップしたいと思います。
ポイント
大体のワーニングはdoctorコマンドの結果に出力されたファイルを
勇気をもって消すことで解決します
目次
- 目次
- Warning: Unbrewed dylibs were found in /usr/local/lib.
- Warning: Unbrewed header files were found in /usr/local/include.
- Warning: Unbrewed .la files were found in /usr/local/lib.
- Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
- Warning: Unbrewed static libraries were found in /usr/local/lib.
- Warning: Broken symlinks were found. Remove them with brew prune:
- すべてのワーニングがクリアされると
- 試した環境
Warning: Unbrewed dylibs were found in /usr/local/lib.
予期しない.dylibが見つかった時に出力されるワーニング
Warning: 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/libmecab.2.dylib /usr/local/lib/libtcl8.6.dylib /usr/local/lib/libtk8.6.dylib
解決
.dylibはダイナミックライブラリ。windowsで言うところのdll
まずは状況確認。 なんやらひどいことに
ichibariki:~ MBPR$ ls -l /usr/local/lib/ total 13552 drwxr-xr-x 9 root wheel 306 3 30 2013 itcl4.0.0 -rwxr-xr-x 1 root wheel 1687184 12 17 17:34 libmecab.2.dylib -rw-r--r-- 1 root wheel 2545264 12 17 17:34 libmecab.a lrwxr-xr-x 1 root wheel 16 12 17 17:34 libmecab.dylib -> libmecab.2.dylib -rwxr-xr-x 1 root wheel 965 12 17 17:34 libmecab.la -r-xr-xr-x 1 root wheel 1419604 3 30 2013 libtcl8.6.dylib -rwxr-xr-x 1 root wheel 4824 3 30 2013 libtclstub8.6.a -rwxr-xr-x 1 root wheel 1239868 3 30 2013 libtk8.6.dylib -rwxr-xr-x 1 root wheel 3464 3 30 2013 libtkstub8.6.a drwxrwxr-x 4 MBPR admin 136 12 17 23:11 pkgconfig drwxr-xr-x 4 root wheel 136 3 30 2013 sqlite3.7.15.1 drwxr-xr-x 5 root wheel 170 3 30 2013 tcl8 drwxr-xr-x 19 root wheel 646 3 31 2013 tcl8.6 -rw-r--r-- 1 root wheel 7977 3 30 2013 tclConfig.sh -rw-r--r-- 1 root wheel 771 3 30 2013 tclooConfig.sh drwxr-xr-x 7 root wheel 238 3 30 2013 tdbc1.0.0 drwxr-xr-x 5 root wheel 170 3 30 2013 tdbcmysql1.0.0 drwxr-xr-x 5 root wheel 170 3 30 2013 tdbcodbc1.0.0 drwxr-xr-x 5 root wheel 170 3 30 2013 tdbcpostgres1.0.0 drwxr-xr-x 5 root wheel 170 3 30 2013 thread2.7.0 drwxr-xr-x 40 root wheel 1360 3 30 2013 tk8.6 -rw-r--r-- 1 root wheel 4334 3 30 2013 tkConfig.sh ichibariki:~ MBPR$
解決策はワーニングに表示されている.dylibを削除する事
下の例では3つのdylibを削除しています
ichibariki:~ MBPR$ rm /usr/local/lib/libmecab.2.dylib override rwxr-xr-x root/wheel for /usr/local/lib/libmecab.2.dylib? y ichibariki:~ MBPR$ ichibariki:~ MBPR$ rm /usr/local/lib/libtcl8.6.dylib override r-xr-xr-x root/wheel for /usr/local/lib/libtcl8.6.dylib? y ichibariki:~ MBPR$ ichibariki:~ MBPR$ rm /usr/local/lib/libtk8.6.dylib override rwxr-xr-x root/wheel for /usr/local/lib/libtk8.6.dylib? y ichibariki:~ MBPR$
Warning: Unbrewed header files were found in /usr/local/include.
この場合はヘッダーファイルの不整合
Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/fakemysql.h /usr/local/include/fakepq.h /usr/local/include/fakesql.h /usr/local/include/itcl.h /usr/local/include/itcl2TclOO.h /usr/local/include/itclDecls.h /usr/local/include/itclInt.h /usr/local/include/itclIntDecls.h /usr/local/include/itclMigrate2TclCore.h /usr/local/include/itclTclIntStubsFcn.h /usr/local/include/mecab.h /usr/local/include/mysqlStubs.h /usr/local/include/odbcStubs.h /usr/local/include/pqStubs.h /usr/local/include/tcl.h /usr/local/include/tclDecls.h /usr/local/include/tclOO.h /usr/local/include/tclOODecls.h /usr/local/include/tclPlatDecls.h /usr/local/include/tclThread.h /usr/local/include/tclTomMath.h /usr/local/include/tclTomMathDecls.h /usr/local/include/tdbc.h /usr/local/include/tdbcDecls.h /usr/local/include/tdbcInt.h /usr/local/include/tk.h /usr/local/include/tkDecls.h /usr/local/include/tkPlatDecls.h
解決方法
解決方法はワーニング表示されたヘッダーファイルを消し込む事です
ichibariki:~ MBPR$ rm -rf /usr/local/include/fakesql.h ichibariki:~ MBPR$ rm -rf /usr/local/include/itcl.h ichibariki:~ MBPR$ rm -rf /usr/local/include/itcl2TclOO.h ichibariki:~ MBPR$ rm -rf /usr/local/include/itclDecls.h ichibariki:~ MBPR$ rm -rf /usr/local/include/itclInt.h ichibariki:~ MBPR$ rm -rf /usr/local/include/itclIntDecls.h ichibariki:~ MBPR$ rm -rf /usr/local/include/itclMigrate2TclCore.h ichibariki:~ MBPR$ rm -rf /usr/local/include/itclTclIntStubsFcn.h ichibariki:~ MBPR$ rm -rf /usr/local/include/mecab.h ichibariki:~ MBPR$ rm -rf /usr/local/include/mysqlStubs.h ichibariki:~ MBPR$ rm -rf /usr/local/include/odbcStubs.h ichibariki:~ MBPR$ rm -rf /usr/local/include/pqStubs.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tcl.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tclDecls.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tclOO.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tclOODecls.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tclPlatDecls.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tclThread.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tclTomMath.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tclTomMathDecls.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tdbc.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tdbcDecls.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tdbcInt.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tk.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tkDecls.h ichibariki:~ MBPR$ rm -rf /usr/local/include/tkPlatDecls.h ichibariki:~ MBPR$ ichibariki:~ MBPR$
Warning: Unbrewed .la files were found in /usr/local/lib.
この場合は.laファイルの不整合
Warning: 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/libmecab.la
対象のディレクトリを確認するとたしかにあります
libmecab.laが
ichibariki:~ MBPR$ ls -l /usr/local/lib total 5056 drwxr-xr-x 9 root wheel 306 3 30 2013 itcl4.0.0 -rw-r--r-- 1 root wheel 2545264 12 17 17:34 libmecab.a lrwxr-xr-x 1 root wheel 16 12 17 17:34 libmecab.dylib -> libmecab.2.dylib -rwxr-xr-x 1 root wheel 965 12 17 17:34 libmecab.la -rwxr-xr-x 1 root wheel 4824 3 30 2013 libtclstub8.6.a -rwxr-xr-x 1 root wheel 3464 3 30 2013 libtkstub8.6.a drwxrwxr-x 4 MBPR admin 136 12 17 23:11 pkgconfig drwxr-xr-x 4 root wheel 136 3 30 2013 sqlite3.7.15.1 drwxr-xr-x 5 root wheel 170 3 30 2013 tcl8 drwxr-xr-x 19 root wheel 646 3 31 2013 tcl8.6 -rw-r--r-- 1 root wheel 7977 3 30 2013 tclConfig.sh -rw-r--r-- 1 root wheel 771 3 30 2013 tclooConfig.sh drwxr-xr-x 7 root wheel 238 3 30 2013 tdbc1.0.0 drwxr-xr-x 5 root wheel 170 3 30 2013 tdbcmysql1.0.0 drwxr-xr-x 5 root wheel 170 3 30 2013 tdbcodbc1.0.0 drwxr-xr-x 5 root wheel 170 3 30 2013 tdbcpostgres1.0.0 drwxr-xr-x 5 root wheel 170 3 30 2013 thread2.7.0 drwxr-xr-x 40 root wheel 1360 3 30 2013 tk8.6 -rw-r--r-- 1 root wheel 4334 3 30 2013 tkConfig.sh ichibariki:~ MBPR$
解決方法
この場合もワーニングに表示された.laファイルを削除する事で解決します
ichibariki:~ MBPR$ rm -rf /usr/local/lib/libmecab.la
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
このワーニングは.pcファイルの不整合となります
Warning: 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/tcl.pc /usr/local/lib/pkgconfig/tk.pc
解決方法
解決方法はワーニングに表示された.pcファイルを削除する事です
ichibariki:~ MBPR$ rm -rf /usr/local/lib/pkgconfig/tcl.pc ichibariki:~ MBPR$ rm -rf /usr/local/lib/pkgconfig/tk.pc
Warning: Unbrewed static libraries were found in /usr/local/lib.
このワーニングはスタティックライブラリの不整合です
Warning: 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/libmecab.a /usr/local/lib/libtclstub8.6.a /usr/local/lib/libtkstub8.6.a
解決方法
解決策はワーニングに表示されたライブラリの削除
対象ファイルを消し込みます
ichibariki:~ MBPR$ rm -rf /usr/local/lib/libmecab.a ichibariki:~ MBPR$ rm -rf /usr/local/lib/libtclstub8.6.a ichibariki:~ MBPR$ rm -rf /usr/local/lib/libtkstub8.6.a
Warning: Broken symlinks were found. Remove them with brew prune
:
このワーニングはリンクが壊れている場合表示されます
Warning: Broken symlinks were found. Remove them with `brew prune`: /usr/local/lib/libmecab.dylib
解決方法
解決策はこわれたリンクの復活
ワーニングに表示されている
brew prune
コマンドで解決できます
ichibariki:~ MBPR$ brew prune Pruned 1 symbolic links and 1 directories from /usr/local
すべてのワーニングがクリアされると
全てのワーニングが解決するとお医者様(brew doctor)に
Your system is ready to brew.
と準備完了のお墨付きをいただけます
ichibariki:~ MBPR$ brew doctor Your system is ready to brew.
参考になれば幸いです。
試した環境
ホストOS
MacBook Pro (Retina, 13-inch, Late 2013) macOS Sierra システムのバージョン: macOS 10.12 (16A323) カーネルのバージョン: Darwin 16.0.0