Homebrew で Homebrew-Cask のコンフリクトの警告が出る場合の対処方法

macOSHomebrew

エラー

brew doctor を実行すると以下のような警告が出ます。

$ brew doctor

Warning: You have external commands with conflicting names.

Found command brew-cask in following places:
/usr/local/bin/brew-cask
/usr/local/Library/Taps/caskroom/homebrew-cask/cmd/brew-cask.rb

原因

2015 年 12 月のアップデートで Homebrew-Cask の作りが変わったようです。 ですので、 2015 年 12 月以前から Homebrew-Cask を利用していて brew update を実行するとその後に「衝突していますよ」と出るようになります。

リリースドキュメントと公式の README には次のように書かれています。

NOTE This is the final release of Homebrew-cask. As of this release, it is no longer necessary to brew install brew-cask. brew tap caskroom/cask will install brew-cask as a Homebrew external command, and brew update will keep it up-to-date.

You can brew update && brew uninstall --force brew-cask to clean up.

Important December update: Homebrew-Cask will now be kept up to date together with Homebrew (see #15381 for details). If you haven’t yet, run brew uninstall --force brew-cask; brew update to switch to the new system.

対処方法

公式に書かれているとおり、 brew update 後に brew uninstall コマンドで Homebrew-Cask をアンインストールすれば OK です。

コンフリクトが発生しているという場合はすでに brew update は実行済みかと思いますので brew uninstall だけでよいでしょう。

$ brew uninstall --force brew-cask

ちなみに Homebrew-Cask はこの先にも動作の変更を予定しているそうで、以下の注意書きもあわせて書かれています。

Important: At some point in the future Homebrew-cask will change its behaviour from linking apps to moving them. See issue #13201 for details.

参考


アバター
後藤隼人 ( ごとうはやと )GitHubPython

ソフトウェア開発やマーケティング支援などをしています。