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

Improve 'Caskroom location has moved' message #24609

Closed
ChrisJefferson opened this issue Sep 19, 2016 · 9 comments
Closed

Improve 'Caskroom location has moved' message #24609

ChrisJefferson opened this issue Sep 19, 2016 · 9 comments

Comments

@ChrisJefferson
Copy link

ChrisJefferson commented Sep 19, 2016

So, the current 'caskroom has moved' message tells me I have 'migrate my Casks'. I can read https://github.com/caskroom/homebrew-cask/issues/21913, which tells me I can:

and maybe I won't be able to uninstall without a --force. And there is one comment with 5 hearts: brew cask install --force $(brew cask list). Is that what I should actually do? Because it doesn't seem to actually do anything (I still don't have a /usr/local/Caskroom)

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

Perhaps change the message to give a suggested thing to run, which will make things work.

@matty
Copy link

matty commented Sep 19, 2016

On a side note, I'm not sure what I need to do, I uninstalled and installed Virtualbox the other day and it didn't go into the new Caskroom folder, is this intentional? Do I need to just move the folders to the new Caskroom location as specified and will that work?

@reitermarkus
Copy link
Member

If the old location /opt/homebrew-cask/Caskroom exists, it will still be used.

@matty
Copy link

matty commented Sep 19, 2016

What about other files related to Caskroom in /opt? e.g /opt/vagrant? Have they moved?

@reitermarkus
Copy link
Member

/opt/vagrant is not related to this. It may have been installed by Homebrew Cask, but it being there is simply because the pkg installer installed it there.

@ChrisJefferson
Copy link
Author

@reitermarkus : So, how do I make it go away cleanly? Uninstall everything, remove directory, reinstall everything?

I tried doing something like CASKS=$(brew cask list); for i in $CASKS..., but unfortunately the way it outputs doesn't seem to get split by bash properly

@jawshooah
Copy link
Contributor

I tried doing something like CASKS=$(brew cask list); for i in $CASKS..., but unfortunately the way it outputs doesn't seem to get split by bash properly

That's because you're not doing bash properly 😉

CASKS=($(brew cask list))
for cask in "${CASKS[@]}"; do
  # whatever
done

@ChrisJefferson
Copy link
Author

ChrisJefferson commented Sep 19, 2016

@jawshooah : Every time I think I've figured out bash :|

Given this new bash-power, I came up with the following, which worked on my computer (You could rm -rf /opt/homebrew-cask/Caskroom if anything is left behind). You should do this a step at a time, not just try cutting+pasting the whole thing in one go (it might, be I don't promise anything

# Grab the casks you have installed
CASKS=($(brew cask list))

# Uninstall everything
for cask in "${CASKS[@]}"; do
  brew cask uninstall --force $cask
done

# Remove the old directory (which is hopefully now empty)
rmdir /opt/homebrew-cask/Caskroom

# Reinstall everything
for cask in "${CASKS[@]}"; do
  brew cask install $cask
done

EDIT: I've edited this based on @jawshooah's comment below (adding --force), to make it easier for anyone who finds this later.

@jawshooah
Copy link
Contributor

You'll want to --force the uninstall to get rid of all installed versions, but yeah, that will probably do what you want.

@vitorgalvao
Copy link
Member

Closing as solved.

@Homebrew Homebrew locked and limited conversation to collaborators May 9, 2018
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

5 participants