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

Comments

@mattfelsen
Contributor

mattfelsen commented Jun 13, 2016

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

This comment has been minimized.

Show comment
Hide comment
@jawshooah

jawshooah Jun 13, 2016

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.

Contributor

jawshooah commented Jun 13, 2016

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

This comment has been minimized.

Show comment
Hide comment
@vitorgalvao

vitorgalvao Jun 13, 2016

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.

Member

vitorgalvao commented Jun 13, 2016

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

This comment has been minimized.

Show comment
Hide comment
@tehmaspc

tehmaspc Jun 13, 2016

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.

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

This comment has been minimized.

Show comment
Hide comment
@msridhar

msridhar Jun 13, 2016

Contributor

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

Contributor

msridhar commented Jun 13, 2016

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

@tehmaspc

This comment has been minimized.

Show comment
Hide comment
@tehmaspc

tehmaspc 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 :).

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

This comment has been minimized.

Show comment
Hide comment
@jawshooah

jawshooah Jun 13, 2016

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.

Contributor

jawshooah commented Jun 13, 2016

#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.

@eegabeeva

This comment has been minimized.

Show comment
Hide comment
@eegabeeva

eegabeeva Jun 14, 2016

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
Contributor

eegabeeva commented Jun 14, 2016

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

This comment has been minimized.

Show comment
Hide comment
@madsem

madsem Jun 14, 2016

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

madsem commented Jun 14, 2016

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

@jawshooah

This comment has been minimized.

Show comment
Hide comment
@jawshooah

jawshooah Jun 14, 2016

Contributor

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

Contributor

jawshooah commented Jun 14, 2016

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

@chrisfinazzo

This comment has been minimized.

Show comment
Hide comment
@chrisfinazzo

chrisfinazzo Jun 14, 2016

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?'

Contributor

chrisfinazzo commented Jun 14, 2016

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

@eegabeeva

This comment has been minimized.

Show comment
Hide comment
@eegabeeva

eegabeeva Jun 15, 2016

Contributor

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

Contributor

eegabeeva commented Jun 15, 2016

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

@zanderzhng

This comment has been minimized.

Show comment
Hide comment
@zanderzhng

zanderzhng Jun 15, 2016

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.

Contributor

zanderzhng commented Jun 15, 2016

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

This comment has been minimized.

Show comment
Hide comment
@herrbischoff

herrbischoff Jun 15, 2016

Contributor

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

Contributor

herrbischoff commented Jun 15, 2016

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

@n8henrie

This comment has been minimized.

Show comment
Hide comment
@n8henrie

n8henrie Jun 15, 2016

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@jawshooah

jawshooah Jun 15, 2016

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.

Contributor

jawshooah commented Jun 15, 2016

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.