LoginSignup
46

More than 1 year has passed since last update.

posted at

updated at

HomebrewでdoctorしたらWarning: You have unlinked kegs in your Cellarとなった時の対応方法

環境
OS : macOS High Sierra
Homebrew : 1.3.7

事象 : brew doctorしたらWarning: You have unlinked kegs in your Cellarとなった

事象
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

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. Run `brew link` on these:
  php56
  ruby

原因 : linkできてないから

対応方法 : いらないパッケージの場合

いらないパッケージ
# 一応unlinkしておく
$ brew unlink php56
Unlinking /usr/local/Cellar/php56/5.6.29_5... 0 symlinks removed

# ディレクトリ削除
$ rm -drf /usr/local/Cellar/php56/

# デッドリンクになっているものを削除 > (追記)「brew prune」じゃなくて「brew cleanup」になりました。
$ brew prune

# 今一度doctorするとphp56が消える
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

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. Run `brew link` on these:
  ruby

対応方法 : いるパッケージの場合

いるパッケージ
# ちゃんとlinkする
$ brew link ruby
Linking /usr/local/Cellar/ruby/2.4.2_1... 3003 symlinks created

# 今一度doctorするとるrubyが消える
$ brew doctor
Your system is ready to brew.

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
46