Brew supported method to remove downloaded files in /Caches

I have installed a cask that is a beta version. While the version number stays the same for this beta there are frequent incremental changes to it and I want to download the latest beta. While force installing over this app is possible - brew keeps using the already downloaded file that sits in /Library/Caches/Homebrew/downloads because the version number hasn’t changed for the package.

I can remove this download using sudo rm but since there is a hash ahead of the file name I am not sure if that will “screw up” my brew install by leaving behind other unknown files associated with that download possibly causing conflicts in the future. Is it cool to sudo rm these files?

$ brew cask cleanup no longer removes these downloads.
Error: Invalid usage: Subcommand cleanup does not exist.

The command you are after is brew cleanup. Run brew cleanup --help to see a list of flags to clean the cache, in particular the -s flag.

1 Like

This works, but it removed every single file in cache. I just wanted to remove one. I think the message was that I can just remove it without any harmful consequences. Thanks