Why are installers stored in Cache? Should be removed


Why are installers/sources for installed formula stored in cache after being installed?
More specifically, what is the purpose of keeping these install files? They just take up space on the drives.

I researched cleaning up cache brew cleanup but it does not remove files for current versions installed, but what is the purpose in that? If it installed properly, why keep these? I know we can remove them with rm -rf $(brew --cache), but I feel like brew cleanup should remove all of these files, or at least have a flag for it, which is why I want to understand a strong reason why these are kept.


Does anybody know why this is case?

(Jacob Ledbetter) #3

Because if you wanted to reinstall it. You would be able to do it w/o downloading the file again. The file can be removed with brew cleanup or brew cask cleanup.


You are right and agree that at times it’s nice to not have to download an installer or source package again, but brew cleanup and brew cask cleanup do not removed caches of formulas installed, it can only be done by rm -rf $(brew --cache).

I think it would be nice to have a flag like brew cleanup -a that scrubs all cache, even for installed formulas, specially for casks as they tend to be bigger files.

(Jacob Ledbetter) #5

If you want, go to the brew GitHub page and create an issue and see if you can get that implemented.


Funny you say that, I did create one a couple of months ago, and got directed here. That’s how I learned this community existed, but alas, I should have probably made the suggestion in the issue rather than asking a question.