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
    5 HTML5 APIs You Didn’t Know Existed

    When you say or read "HTML5", you half expect exotic dancers and unicorns to walk into the room to the tune of "I'm Sexy and I Know It."  Can you blame us though?  We watched the fundamental APIs stagnate for so long that a basic feature...

  • By
    Serving Fonts from CDN

    For maximum performance, we all know we must put our assets on CDN (another domain).  Along with those assets are custom web fonts.  Unfortunately custom web fonts via CDN (or any cross-domain font request) don't work in Firefox or Internet Explorer (correctly so, by spec) though...

Incredible Demos

  • By
    Check All/None Checkboxes Using MooTools

    There's nothing worse than having to click every checkbox in a list. Why not allow users to click one item and every checkbox becomes checked? Here's how to do just that with MooTools 1.2. The XHTML Note the image with the ucuc ID -- that...

  • By
    Retrieve Google Analytics Visits and PageViews with PHP

    Google Analytics is an outstanding website analytics tool that gives you way more information about your website than you probably need. Better to get more than you want than not enough, right? Anyways I check my website statistics more often than I should and...

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!