Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to migrate to the new location? #21913

Closed
mattfelsen opened this issue Jun 13, 2016 · 15 comments
Closed

How to migrate to the new location? #21913

mattfelsen opened this issue Jun 13, 2016 · 15 comments

Comments

@mattfelsen
Copy link
Contributor

Good morning! Since the location change and #21901, I'm now seeing the warning about migrating Casks, as expected. I've searched around a bit but don't understand what I need to do as an end-user. Is there a command for migrating? Is it simply a move of the /opt/homebrew-cask/Caskroom/ directory to /usr/local/Caskroom/? A bit more info would be helpful as I don't want to muck anything up. Thanks!

@jawshooah
Copy link
Contributor

Yes, the simplest thing would be to mv /opt/homebrew-cask/Caskroom /usr/local. However, any casks installed prior to #13966 were symlinked rather than moved to their destinations, so you'll need to re-install those manually.

If we do wind up phasing out --caskroom, it won't be for a while, so you have plenty of time to find old casks and brew cask install --force them.

@vitorgalvao
Copy link
Member

Closing the issue as it has been answered, but making it the default to answer the questions that arise.

If new questions come up, we should edit @jawshooah’s comment to make it clearer.

@tehmaspc
Copy link

I just re-installed one of my Caskroom apps and noticed that it was still installed to /opt/homebrew-cask/Caskroom? Doesn't seem like homebrew-cask is properly defaulting? I don't have any HOMEBREW_CASK_OPTS options set.

@msridhar
Copy link
Contributor

@tehmaspc same for me; it was the eclipse-java app. Re-installing other apps hasn't had the same problem thus far.

@tehmaspc
Copy link

tehmaspc commented Jun 13, 2016

Ah. I tested my sonos app. So there are individual casks that must be expecting /opt/homebrew-cask/Caskroom then or something. For now I'm going to set HOMEBREW_CASK_OPTS :).

@jawshooah
Copy link
Contributor

#21901 changed the behavior to default to the old location if it still exists and print a warning about the new default, to mitigate the issues brought about by the original change. No need to change HOMEBREW_CASK_OPTS if you delete /opt/homebrew-cask/Caskroom.

@pachecolp
Copy link
Contributor

After receiving the warning, I've moved my Caskroom to /usr/local/Caskroom. Now brew cask list lists the installed casks but brew cask uninstall can't remove them.

➜  Casks git:(master) brew cask list
hazel                   textmate
iterm2                  the-unarchiver
java                    transmission
jettison (!)                vagrant
macports                virtual box
mplayerx                virtualbox-extension-pack
source tree             vlc
stremio
➜  Casks git:(master) brew cask uninstall hazel
Error: hazel is not installed
➜  Casks git:(master) brew cask uninstall mplayerx
Error: mplayerx is not installed

@madsem
Copy link

madsem commented Jun 14, 2016

@grootknol you have to brew cask install APP_NAME --force

@jawshooah
Copy link
Contributor

@grootknol This is a result of a known issue with brew cask list (#14058). You have to brew cask uninstall --force mplayerx

@chrisfinazzo
Copy link
Contributor

Good to know, I just hit this. Currently have no Casks installed, but will open a PR when BBEdit 11.6 gets released. Assuming that @jawshooah is correct in how this should be handled, is it worth adding a line to the output of brew cask list just to tell people 'here's what you need to do?'

umi-uyura added a commit to umi-uyura/dotfiles that referenced this issue Jun 14, 2016
@pachecolp
Copy link
Contributor

Could I just do for cask in $(brew cask list) do; brew cask install $cask --force; after moving Caskroom to the new directory?

@zanderzhng
Copy link
Contributor

for me I did find /usr/local/Caskroom -name "*.app" -maxdepth 3 -exec mv {} ~/Applications \; after moving cask room and removing all the alias.

@herrbischoff
Copy link
Contributor

@grootknol: Even simpler... brew cask install --force $(brew cask list)

@n8henrie
Copy link
Contributor

n8henrie commented Jun 15, 2016

I had a ton of Casks that were still symlinked from ~/Applications to /opt/homebrew-cask/Caskroom, so I first moved my Caskroom using the command above mv /opt/homebrew-cask/Caskroom /usr/local then changed all the symlinks to match the new location:

for f in ~/Applications/*.app; do oldloc="$(readlink "$f")"; [[ -e $oldloc ]] || ln -sf "/usr/local${oldloc#/opt/homebrew-cask}" "$f"; done

Seems to have worked.

@jawshooah
Copy link
Contributor

The solutions presented in this thread should work equally well for other symlinked artifacts, so I'm locking it. Feel free to open a new issue if you have trouble.

@Homebrew Homebrew locked and limited conversation to collaborators Jun 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests