Search code examples
homebrewhomebrew-cask

The default Caskroom location has moved to /usr/local/Caskroom


When I try to install a new cask a message appears:

"The default Caskroom location has moved to /usr/local/Caskroom"

How to move the old directory without breaking the links to the new location?


Solution

  • Recipe

    # FIRST SOLUTION
    
    # reinstall all casks (can be slow)
    brew cask install --force $(brew cask list)
    
    # --------------------------------------
    
    # SECOND SOLUTION
    
    # move cask directory to its new location
    mv /opt/homebrew-cask/Caskroom /usr/local
    
    # relink existing casks to the new location
    for f in ~/Applications/*.app; do oldloc="$(readlink "$f")"; [[ -e $oldloc ]] || ln -sf "/usr/local${oldloc#/opt/homebrew-cask}" "$f"; done
    

    See here for more information: https://github.com/caskroom/homebrew-cask/issues/21913