12

I recently installed an app with homebrew-cask, but I want to handle its updates by myself and not via brew cask upgrade.

Is there a command or option to remove a cask from the local list, without uninstalling it?

If I use brew cask remove or brew cask uninstall the app will be uninstalled.

I'm looking for something like brew cask forget or something similar.

itg-dave
  • 174
  • 3
  • 10

2 Answers2

26

I found an answer over at Apple Stack Exchange: Delete the folder of the app you want to forget from /usr/local/Caskroom. On Apple silicon Macs, the location is /opt/homebrew/Caskroom

Eddie Groves
  • 33,851
  • 14
  • 47
  • 48
stephenwade
  • 1,057
  • 2
  • 20
  • 37
  • 1
    Well, who thought it was so simple. Thank you! – itg-dave Apr 21 '20 at 23:57
  • 3
    Alternatively you can do `brew uninstall --force --verbose ` if you are stuck with package which may have shipped with manual uninstaller or the one which is corrupt and it is conflicting with another one you are trying to install. – azec-pdx Oct 12 '20 at 15:50
  • 9
    On M1 mac, the location is now `/opt/homebrew/Caskroom`. – Ortomala Lokni Mar 17 '22 at 07:28
1

It does not exist a way of unlink/forget a cask in the new version. It was possible to unlink a cask in previous versions but this changed, now the only thing like this is rename the artifact itself instead of a link.:

I suggest you the next:

  • You could install the app manually without using brew cask this will prevent cask of knowing about the app so you'll be able to control when to upgrade the app.

  • In case you´ve already installed the app you can uninstall it and then install it manually or just change the name of the app, for example, adding the prefix _App.app then uninstall it using brew cask uninstall App and then rename it to the original name: App.app.

  • Another option is removing autoupdate true from the formulae, you can do this using brew cask edit app and then removing it, this will prevent the app to be upgraded when you use brew cask upgrade. You'll need to know the app will be upgraded in case you run brew cask upgrade --greedy, so instead upgrade the apps without autoupdate true one by one: brew cask upgrade app. You'll know which apps can be updated but they're not automatically updated using brew cask outdated --greedy.

  • Finally, using brew tap homebrew/cask-versions you can control the versions you want to have installed if they're available in https://github.com/Homebrew/homebrew-cask-versions/tree/master/Casks.

Pau
  • 14,917
  • 14
  • 67
  • 94
  • Thanks for the detailed answer, @pau ! While those recommendations all make sense, they don't provide the solution I'm looking for: just letting brew forget the cask as it was never installed. – itg-dave Nov 20 '18 at 10:40
  • 2
    notes. `brew cask` is deprecated. use `brew uninstall --cask caskname` instead. – John Apr 11 '21 at 16:39