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

Can't uninstall old versions #7409

Closed
FiloSottile opened this issue Nov 17, 2014 · 6 comments
Closed

Can't uninstall old versions #7409

FiloSottile opened this issue Nov 17, 2014 · 6 comments

Comments

@FiloSottile
Copy link
Contributor

I'm puzzled that I didn't find this in the FAQ or open issues, since I guess it affects most users, so if I just missed it I apologize in advance.

Consider the following workflow:

brew cask install foo

brew update
# foo gets updated

brew list
# foo is present

brew uninstall foo
# Error: foo is not installed

Why does that happen? Cask can't uninstall old versions?

Here is a real example:

➜  brew cask uninstall carbon-copy-cloner
Error: carbon-copy-cloner is not installed
➜  brew cask list
carbon-copy-cloner   flux             font-open-sans       hipchat          skitch           sublime-text         viscosity
diffmerge        font-bebas-neue      font-source-code-pro     iterm2           skype            torbrowser           vlc
dropbox          font-camingocode     google-chrome        plug             spectacle            vagrant              wireshark
firefox          font-droid-sans-mono     google-drive         private-internet-access  steam            virtualbox           xquartz
@FiloSottile
Copy link
Contributor Author

Ok, found #2988.

I still think cask uninstall should suggest to the user that they might want brew cask uninstall --force if there are other versions, so consider this issue a feature request for that message.

Seeing a name in list and then not being able to uninstall or list it feels really really wrong.

@vitorgalvao
Copy link
Member

so consider this issue a feature request for that message.

That would be a poor solution to a deeper problem. We should solve the origin of the issue instead (which is what the issue you linked to is tracking).

I understand your thinking that doing it “for now” would be faster, but homebrew-cask is very much in alpha stage and this is a minor inconvenience, so polluting the code base with such messages that will need to be removed later is not a good policy.

@FiloSottile
Copy link
Contributor Author

I remember the "upgrading issue" to be open for a long time, and something like that requires a lot of planning indeed to get it right.

Meanwhile however, a lot of users will waste time on this, or simply give up and not uninstall things.

Consider that for example oh-my-zsh autocompletion for brew-cask will autocomplete from list, so it will autocomplete a command that will fail, and that is really confusing.

I know it's just a stopgap, but I think it's a useful stopgap.

@FiloSottile
Copy link
Contributor Author

Umh, thinking about it, can you elaborate on why --force is not the standard behavior?

When does a user typing brew cask uninstall foo actually mean "uninstall only the latest version of foo, not any older one"?

@vitorgalvao
Copy link
Member

I know it's just a stopgap, but I think it's a useful stopgap.

Like I said:

I understand your thinking that doing it “for now” would be faster, but homebrew-cask is very much in alpha stage and this is a minor inconvenience, so polluting the code base with such messages that will need to be removed later is not a good policy.

Alpha very much means “you shouldn’t really be using this day-to-day” (though most of us are) and having some minor things not work is, in my view, preferable to introducing workarounds to the code base that will need to be removed later. That said, I’ll ping @rolandwalker on this, since he’d likely be the one to do it, which naturally makes his opinion have more weight.

On the other hand

can you elaborate on why --force is not the standard behavior?

I have no freaking idea. Having a separate --force behaviour makes sense in cases like homebrew, with cli apps, but in homebrew-cask, especially since we have a different repo for older versions, there’s really not much reason to not remove everything on uninstall. This will likely be resolved with the implementation of upgrading and adding metadata on installations, but still.

@rolandwalker
Copy link
Contributor

Hi @FiloSottile !

The original behavior of brew cask uninstall was defined by our beloved founder @phinze. I am not certain, but suspect that one reason for the design was to support multiple side-by-side versions of the same application, which we are still interested in, though it currently seems less important than upgrades.

brew cask uninstall --force was only added about 30 days ago (#6208). As install/uninstall is core functionality here, and as brew cask gets run by other scripts, it is preferable to change the behavior in a backwards-compatible way, ie by adding a CLI option. --force was chosen to match the existing brew cask install --force.

We could certainly consider changing the default behavior, ideally with a transition plan as with the recent DSL changes. However, I don't think that will be needed. After #3066, we will always be able to find the most-recent installation, and thus will always be able to uninstall it.

As to the original feature request, I think a message re: brew cask uninstall --force could be reasonable, when brew cask uninstall fails, and an out-of-date version of the cask is detected.

PS The upgrade issue has not been open a long time because we are doing planning. It has been open a long time because it is a roadmap for ongoing work. Most of the current activity is on the related roadmap #4688.

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

3 participants