I’m using Homebrew on my Macbook. It is a great addition to installing software when you are used to package managers from the Linux world.
There’s also an extension called Homebrew Cask which allows you to manage MacOS applications, such as Adium or Gimp. This saves you the hassle of manually downloading the package/dmg files and automates the installation/updates.
Lately when doing an update again, there was a notice about a changed Caskroom location.
michi@mbmif ~ $ brew cask list Warning: The default Caskroom location has moved to /usr/local/Caskroom. Please migrate your Casks to the new location and delete /opt/homebrew-cask/Caskroom, 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. apache-directory-studio filezilla gimp macvim vlc xquartz bitbar firefox java7 mysqlworkbench wireshark
Ok, what would I do now? “Migration” could just mean moving the directories. But wait, the installed applications could be symlinked into ~/Applications instead of being moved (#13966).
Looking into the mentioned github issue #21913 shed some light on how to fix it. Moving the directories will make “brew cask list” shut up about the changed location, but later uninstalls will fail due to dangling symlinks. The solution is simple – force an installation again after moving the installed casks.
michi@mbmif ~ $ mv /opt/homebrew-cask/Caskroom /usr/local michi@mbmif ~ $ brew cask list apache-directory-studio filezilla gimp macvim vlc xquartz bitbar firefox java7 mysqlworkbench wireshark michi@mbmif ~ $ for cask in $(brew cask list); do brew cask install $cask --force; done
Done 🙂
Thanks this helped
Great job! Thanks 🙂
You can avoid installing everything again by recreating the symlinks using:
gfind ~/Applications/ ~/Library/ /usr/local/ -type l -lname ‘/opt/homebrew-cask/*’ -printf “ln -vsf ‘%l’ ‘%p’\n” | sed s,/opt/homebrew-cask/,/usr/local/, | bash
Please note that you’ll need to `brew install findutils` first… 🙂