Help us understand the problem. What is going on with this article?

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

More than 3 years have passed since last update.

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした