Update on Homebrew

The other day I wrote a post about the Mac pack­age man­ager, Home­brew. After using the pro­gram and get­ting to know it a bit bet­ter, I need to make a cor­rec­tion to some­thing I said there.

There is an update com­mand for Home­brew: brew update. Run this on occa­sion and you’ll see a list of pack­ages that have been updated or elim­i­nated. If you pay atten­tion, you might notice that, e.g., the for­mula for git has changed to 1.7.2.1. But a git --version will reveal that your ver­sion hasn’t changed. So what gives?

It turns out that brew update does not update all your Home­brew installed pro­grams auto­mat­i­cally. That makes sense, actually–you might have a rea­son to want to stick with an old ver­sion of something.

If you know you want to update all your Home­brew pro­grams, you can run brew install `brew outdated`. That will deter­mine which files have been changed and re-install the ones rel­e­vant to you.

If you want to be more selec­tive, you can run this as a two-step process. First, a brew outdated will tell you which pro­grams have changed. It will also tell you the ver­sion num­ber for the new ver­sion, if that mat­ters to you. Then you can brew install X for your out­dated programs.

Note: Home­brew still seems a lit­tle bit rough around the edges to me. I suc­cess­fully installed a hand­ful of pro­grams using it, but when I tried to update one of them (the Haskell plat­form), I couldn’t get it to install prop­erly. Rather than try­ing to track down the error (it is get­ting late), I ended up using my basic work­ing knowl­edge of git (the ver­sion con­trol sys­tem that makes brew update and brew outdated pos­si­ble) to go back to an older ver­sion of the pro­gram to install. I’m no git expert, so this couldn’t have taken that much acu­men, but it did take a lit­tle bit of knowl­edge. I’d still rec­om­mend Home­brew, but as with any com­mand line based pro­gram, I’d say if you use it you risk learn­ing more about your com­puter than you might’ve wanted to know.

Posted Wednesday, July 28th, 2010 under Mac.

5 comments

  1. Kevin Klement says:

    I love the last line. So true.

    Before you know it, you’ll be writ­ing shell scripts, and before long, actual pro­grams, and full on geek­dom can’t be far behind.

  2. Paul Thomas says:

    Great post. Thank you. Here are a few more bread­crumbs for my fel­low darwin/Mac OS X trav­el­ers: (1) aban­don Mac­Ports. Here’s what you must do to become clean: http://​guide​.mac​ports​.org/​c​h​u​n​k​e​d​/​i​n​s​t​a​l​l​i​n​g​.​m​a​c​p​o​r​t​s​.​u​n​i​n​s​t​a​l​l​i​n​g​.​h​tml;

    (2) read the brew tea leaves. –brew doc­tor– gave me the fol­low­ing home­work assign­ments: i. update my $PATH — put /usr/local/bin ahead of the rest; ii. make sure you have -> export LC_ALL=(unset) export LC_CTYPE=en_US.UFT-8 export LANG=en_US.UTF-8 defaults write org.R-project.R force.LANG en_US.UTF-8

    (3) do –brew audit-. I was told to chmod 644 all files in /usr/local/Library/Formula.

    (4) work your way through the com­mands : https://​github​.com/​m​x​c​l​/​h​o​m​e​b​r​e​w​/​w​i​k​i​/​T​h​e​-​b​r​e​w​-​c​o​m​m​and

    Thanks again. open source is love

  3. Paul Thomas says:

    ok. I’d like to retract part of step (2). –Brew Doc­tor– was right on. How­ever, every­thing else messed up my “set­lo­cale” set­tings. So I com­mented out the lines in my .bashrc that set the LC_ vars used by setlocale:

    export LC_ALL=(unset)

    export LC_TIME=en_US.UTF-8

    export LC_CTYPE=en_US.UFT-8

    export LANG=en_US.UTF-8

    defaults write org.R-project.R force.LANG en_US.UTF-8

    I went through ‘brew’ com­mands and things seem to work ok. .. and ‘cal’ doesn’t give errors. I’ve still got a ways to go .. –sigh–

    • Paul, Thanks for all the details. I didn’t have Mac­Ports installed, and I didn’t run into any of these issues, so I didn’t know about them. Thanks for the heads up. Good luck get­ting every­thing straight­ened out!

Leave a Reply