LoginSignup
55
47

More than 1 year has passed since last update.

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

Last updated at Posted at 2017-11-19

環境
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.
55
47
0

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
  3. You can use dark theme
What you can do with signing up
55
47