Open musse opened 6 months ago
I see the PR to fix this in homebrew-cask is merged, but doing brew update
does not seem to fix this issue, is anything else necessary?
@DamianPereira Even after the homebrew-cask
fix was merged, there was a "cached" copy of the background-music.rb
file (I don't remember the exact path), I had to manually edit it to match the fixed file to be able to uninstall it.
Thank you! I'll check it out.
Similar issue, also happening with ExistentialAudio/BlackHole
$ brew uninstall -f background-music
==> Uninstalling Cask background-music
==> Removing launchctl service com.bearisdriving.BGM.XPCHelper
==> Uninstalling packages with sudo; the password may be necessary:
==> Removing files:
/Library/Application Support/Background Music
/Library/Audio/Plug-Ins/HAL/Background Music Device.driver
/usr/local/libexec/BGMXPCHelper.xpc
Could not kickstart service "com.apple.audio.coreaudiod": 1: Operation not permitted
Error: Failure while executing; `/usr/bin/sudo -E -- /bin/launchctl kickstart -kp system/com.apple.audio.coreaudiod` exited with 1. Here's the output:
Could not kickstart service "com.apple.audio.coreaudiod": 1: Operation not permitted
$ brew info background-music
==> background-music: 0.4.0
https://github.com/kyleneideck/BackgroundMusic
/opt/homebrew/Caskroom/background-music/0.4.0 (895KB)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/b/background-music.rb
==> Name
Background Music
==> Description
Audio utility
==> Artifacts
BackgroundMusic-0.4.0.pkg (Pkg)
==> Analytics
install: 2,133 (30 days), 7,116 (90 days), 23,090 (365 days)
ok manually editing /opt/homebrew/Caskroom/background-music/.metadata/0.4.0/20231226055056.585/Casks/background-music.rb
with the patch did let me uninstall
ok manually editing
/opt/homebrew/Caskroom/background-music/.metadata/0.4.0/20231226055056.585/Casks/background-music.rb
with the patch did let me uninstall
Can you help me with this? What exactly do I need to edit in this file? I'm just trying to update but that's not possible when I cannot uninstall
@lead0r Is this what you're looking for? https://github.com/Homebrew/homebrew-cask/pull/169322/files
@lead0r Is this what you're looking for? https://github.com/Homebrew/homebrew-cask/pull/169322/files
Yes, thank you, that worked!
Can anyone please say how they managed to fix this issue? This is the formula on my Mac that is causing the problem:
cask "background-music" do
version "0.4.3"
sha256 "c1c48a37c83af44ce50bee68879856c96b2f6c97360ce461b1c7d653515be7fd"
url "https://github.com/kyleneideck/BackgroundMusic/releases/download/v#{version}/BackgroundMusic-#{version}.pkg"
name "Background Music"
desc "Audio utility"
homepage "https://github.com/kyleneideck/BackgroundMusic"
livecheck do
url :url
strategy :github_latest
end
pkg "BackgroundMusic-#{version}.pkg"
uninstall_postflight do
system_command "/usr/bin/killall",
args: ["coreaudiod"],
sudo: true,
must_succeed: true
end
uninstall launchctl: "com.bearisdriving.BGM.XPCHelper",
quit: "com.bearisdriving.BGM.App",
pkgutil: "com.bearisdriving.BGM",
delete: [
"/Library/Application Support/Background Music",
"/Library/Audio/Plug-Ins/HAL/Background Music Device.driver",
"/usr/local/libexec/BGMXPCHelper.xpc",
]
zap trash: [
"/Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist",
"~/Library/Preferences/com.bearisdriving.BGM.App.plist",
]
end
I tried editing it to remove the lines @kyleneideck linked, but then the hash changes and brew won't use it.
Edit: GPT-4 helped! I followed suggestion #2 and it got rid of this app once and for all.
Thanks, followed suggestions by https://github.com/kyleneideck/BackgroundMusic/issues/727#issuecomment-2032782997 and https://github.com/kyleneideck/BackgroundMusic/issues/727#issuecomment-2079178105 worked.
Thanks, followed suggestions by #727 (comment) and #727 (comment) worked.
Same here. Great find!
A potentially easier solution is to remove the file from the Caskroom and then reinstall it. This will cause Brew to use the most up-to-date uninstall stanza, instead of the one that was present when the installed version was installed.
Silicon Mac
rm -rfi /opt/homebrew/Caskroom/background-music/
Intel Mac
rm -rfi /usr/local/Caskroom/background-music/
Then reinstall
brew reinstall background-music
A potentially easier solution is to remove the file from the Caskroom and then reinstall it. This will cause Brew to use the most up-to-date uninstall stanza, instead of the one that was present when the installed version was installed.
Silicon Mac
rm -rfi /opt/homebrew/Caskroom/background-music/
Intel Mac
rm -rfi /usr/local/Caskroom/background-music/
Then reinstall
brew reinstall background-music
Thank you. It seems that this was helpful, I just uninstalled it (rm) but how can I double-check that I finally got rid of this?
I've tried solution with patched cask, but it doesn't work for me (it's already changed as in this PR.
Sonoma 14.5
It worked for me on macOS Sonoma.
I edited the file /opt/homebrew/Caskroom/background-music/.metadata/0.4.0/20240126155155.905/Casks/background-music.rb
as suggested here.
After that, running brew uninstall background-music
finally worked!
Can confirm that the previously mentioned patch is also necessary on macOS Sonoma in order to get Background Music uninstalled.
Description of the bug Cannot uninstall after install with
brew
on macOS 14.4:https://developer.apple.com/documentation/macos-release-notes/macos-14_4-release-notes#Core-Audio
Steps to reproduce
brew
;brew
.Versions