Error: Cask ‘wine-stable’ definition is invalid: invalid depends_on key: ‘:x11’

Updating a Ruby file will fix this. This one took me a bit to find.

Error: Cask ‘wine-stable’ definition is invalid: invalid depends_on key: ‘:x11’

I’m getting this error whether I run

brew upgrade, brew install --caske wine-stable or brew uninstall --cask wine-stable.

I think the issue is that x11 is now deprecated and if you installed this version of wine, you can’t uninstall it until you tell this specific file that has the error, to no longer use that flag.

Run this command to figure out which file has the error you’re looking for:

find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | xargs -0 grep "depends_on x11"

This will tell you where the file is at:

  1. Open that file with an editor (e.g. nano or vs code in my case)
  2. Comment out the line that says depends_on x11: true
  3. Save

Now run brew uninstall wine-stable and then wine upgrade and that should work

Source:

https://georgeficzeri.medium.com/error-cask-inkscape-definition-is-invalid-invalid-depends-on-key-x11-91530758599c

Leave a Comment

Your email address will not be published. Required fields are marked *