LoginSignup
30
26

More than 5 years have passed since last update.

Homebrew-Cask を /usr/local/Caskroom に移行する方法

Posted at

tl;dr

$ find /Applications -type l -depth 1 -exec rm {} \;
$ mv /opt/homebrew-cask/Caskroom /tmp/
$ brew cask install $(\ls /tmp/Caskroom)
$ brew prune

上記方法だと /Applications に独自に ln -s したアプリも削除しちゃうので注意。

概要

brew cask install などで下記の Warning が出てしまう件の移行方法について。

Warning: The default Caskroom location has moved to /usr/local/Caskroom.

Please migrate your Casks to the new location, or if you would like to keep your
Caskroom at /opt/homebrew-cask/Caskroom, add the following to your HOMEBREW_CASK_OPTS:

  --caskroom=/opt/homebrew-cask/Caskroom

For more details on each of those options, see https://github.com/caskroom/homebrew-cask/issues/21913.

原因

  • いままで
    • /opt/homebrew-cask/Caskroom 以下に Cask名のディレクトリーと各Cask毎のバージョン毎のディレクトリーを作り、 *.app を /Applications に ln -s する。
  • 変更後
    • /usr/local/Caskroom 以下に Cask名のディレクトリーを作るけど、*.app は直接 /Applications にインストールする。

/usr/local 以下の *.app は Spotlight から検索できない弊害もあるので、mv /opt/homebrew-cask/Caskroom /usr/local/ ではなく各Cask を改めてインストールし直しが良さそうです。

例外

手元の環境だと上記の方法では adobe-reader のインストーラーでエラーが起きてうまくインストールできませんでした。
AppCleaner で Adobe Acrobat Reader DC.app をアンインストールしてから上記の方法で問題ない模様。

See Also

30
26
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
30
26