Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew cleanup doesn't clean ~/Library/Caches/Homebrew #3784

Closed
galad87 opened this issue Feb 10, 2018 · 6 comments
Closed

brew cleanup doesn't clean ~/Library/Caches/Homebrew #3784

galad87 opened this issue Feb 10, 2018 · 6 comments

Comments

@galad87
Copy link

galad87 commented Feb 10, 2018

I noticed brew keeps a copy of the files it downloads in ~/Library/Caches/Homebrew , and the "brew doctor" command doesn't clean it.

For example:

[damians@iMac ~]$ brew cleanup
Removing: /usr/local/Cellar/ffmpeg/3.4.1... (248 files, 50.9MB)
Removing: /usr/local/Cellar/x264/r2795... (11 files, 3.2MB)
==> This operation has freed approximately 54.1MB of disk space.

And in the Cache folder there are still:

[damians@iMac ~]$ ls ~/Library/Caches/Homebrew
ffmpeg-3.4.1_1.high_sierra.bottle.tar.gz x264-r2854.high_sierra.bottle.tar.gz

@chdiza
Copy link
Contributor

chdiza commented Feb 10, 2018

man brew will show you the -s flag for cleanup.

Even then, cleanup doesn't always get everything.

@vitorgalvao
Copy link
Member

The cleanup section of brew’s man page (emphasis mine):

For all installed or specific formulae, remove any older versions from the cellar. In addition, old downloads from the Homebrew download-cache are deleted.

If --prune=days is specified, remove all cache files older than days.

If --dry-run or -n is passed, show what would be removed, but do not actually remove anything.

If -s is passed, scrub the cache, removing downloads for even the latest versions of formulae. Note downloads for any installed formulae will still not be deleted. If you want to delete those too: rm -rf $(brew --cache)

This is expected behaviour. If you want to remove everything, run the suggested rm command.

@galad87
Copy link
Author

galad87 commented Feb 10, 2018

Thanks for the answer. What's the use of keeping already installed formulae downloads files around?

@chdiza
Copy link
Contributor

chdiza commented Feb 10, 2018

In case something goes wrong and you have to reinstall.

@vitorgalvao
Copy link
Member

Closing issue as solved (clarified).

@MikeMcQuaid
Copy link
Member

@galad87 In future always, always, always fill out the issue template, please.

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants