brew cask更新或卸载错误:定义无效:无效的'depends_on macos'值:“:lion”

Pau*_*Pau 5 macos homebrew homebrew-cask

由于定义错误,我无法卸载或升级某些木桶。

如果我运行更新或升级,则:

brew cask upgrade the-unarchiver  
Error: Cask 'the-unarchiver' definition is invalid: invalid 'depends_on macos' value: ":lion"

brew cask uninstall the-unarchiver 
Error: Cask 'the-unarchiver' definition is invalid: invalid 'depends_on macos' value: ":lion"
Run Code Online (Sandbox Code Playgroud)

我尝试查看公式中是否可以编辑某些内容,但没有发现与此错误相关的任何内容。

cask 'the-unarchiver' do
  version '4.1.0,121:1549634528'
  sha256 'ff97b168f07d084e88f48e5d1e5202445596acd6eec39685d28910ee71d3a74b'

  # devmate.com/com.macpaw.site.theunarchiver was verified as official when first introduced to the cask
  url "https://dl.devmate.com/com.macpaw.site.theunarchiver/#{version.after_comma.before_colon}/#{version.after_colon}/TheUnarchiver-#{version.after_comma.before_colon}.zip"
  appcast 'https://updates.devmate.com/com.macpaw.site.theunarchiver.xml'
  name 'The Unarchiver'
  homepage 'https://theunarchiver.com/'

  auto_updates true

  app 'The Unarchiver.app'

  zap trash: [
               '~/Library/Caches/cx.c3.theunarchiver',
               '~/Library/Cookies/cx.c3.theunarchiver.binarycookies',
               '~/Library/Preferences/cx.c3.theunarchiver.plist',
               '~/Library/Saved Application State/cx.c3.theunarchiver.savedState',
             ]
end
Run Code Online (Sandbox Code Playgroud)

Pau*_*Pau 11

自制酒桶开发人员由于维护成本高而删除了pre-maverics依赖项支持,因此他们似乎引入了一个错误。

修复它的方法是运行:

/usr/bin/find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | /usr/bin/xargs -0 /usr/bin/perl -i -0pe 's/depends_on macos: \[.*?\]//gsm;s/depends_on macos: .*//g'
Run Code Online (Sandbox Code Playgroud)

您可以在以下位置找到此解决方案,此错误的原因和更多信息:

https://github.com/Homebrew/homebrew-cask/issues/58046

  • @nmr 谢谢!这就是我一直在寻找的。也无法卸载 Wine。 (4认同)
  • FWIW这似乎也适用于其他损坏的依赖项,例如`brew uninstall wine-stable错误:木桶'wine-stable'定义无效:无效depends_on key:':x11'` - >`/ usr / bin / find“$ (brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | /usr/bin/xargs -0 /usr/bin/perl -i -0pe 's/depends_on x11: \[.*?\]//gsm;s/depends_on x11: .*//g'` -> 卸载现在成功了 (3认同)