Regain Disk Space from Homebrew

By  on  

One of my favorite utilities is Homebrew, the shell utility for installing and upgrading other utilities -- it's a lazy developer's dream.  Dreams can easily turn to nightmares, however, and I recently learned that Homebrew caches older versions of installed packages, leading to loads of disk space being used up by old files.

Want all of that disk space back?  Run brew cleanup -s:

Homebrew cleanup

I understand why Homebrew keeps the previous versions around but when utilities are stable, it's really time to take back the bytes.  My first run of brew cleanup -s recovered 640MB of disk space, which is peanuts relative to the size of modern hard drives, but it's space that I want back!

Recent Features

  • By
    39 Shirts – Leaving Mozilla

    In 2001 I had just graduated from a small town high school and headed off to a small town college. I found myself in the quaint computer lab where the substandard computers featured two browsers: Internet Explorer and Mozilla. It was this lab where I fell...

  • By
    CSS vs. JS Animation: Which is Faster?

    How is it possible that JavaScript-based animation has secretly always been as fast — or faster — than CSS transitions? And, how is it possible that Adobe and Google consistently release media-rich mobile sites that rival the performance of native apps? This article serves as a point-by-point...

Incredible Demos

  • By
    iPhone-Style Passwords Using MooTools PassShark

    Every once in a while I come across a plugin that blows me out of the water and the most recent culprit is PassShark: a MooTools plugin that duplicates the iPhone's method of showing/hiding the last character in a password field. This gem of...

  • By
    PHP / MooTools 1.2 Accordion Helper

    The MooTools Accordion plugin seems to be the plugin that people seem to have the most problems with. It's an awesome plugin, so I can see why so many people want to use it, but I think that may be part of the problem.

Discussion

  1. Nelson Rocha

    Just dropping a huge thank you for sharing this!

    ==> This operation has freed approximately 6.9GB of disk space.
    
  2. gn0st1c

    another thank you.. just saved ~2gb.

    ==> This operation has freed approximately 1.9GB of disk space.

  3. dorian logan

    df -==> This operation has freed approximately 562.3MB of disk space.

  4. I got about 32.2GB back on my laptop, which out of a 250GB drive is a chunk of space worth having. That also might explain why my Time Machine backups were always much bigger than I was expecting. Thanks for the tip. One question: I didn’t include the “-s” parameter – what does that do?

    • Andres

      mauvedeity : scrub the cache, I guess

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!