Ignore formula on brew upgrade

Homebrew

Homebrew Problem Overview


I want to do a brew upgrade and tell homebrew do not upgrade the erlang formula since the latest one does not work on my system.

Is it possible do do something like homebrew upgrade --skip erlang?

Homebrew Solutions


Solution 1 - Homebrew

I finally found an answer: since commit 85eb73ce there is a pin subcommand available. So ignoring a formula on brew upgrade is as simple as pinning it via brew pin <formula>. To un-pin it, simply invoke brew unpin <formula>.

It is worth noting that brew upgrade <formula> will still update the formula regardless of whether or not it is pinned.

Caveat: This answer is no longer valid for recent versions of Homebrew, since brew pin has been removed.

Solution 2 - Homebrew

brew pin is the way to go. It will pin the formula to the current version

brew pin <formula>

brew unpin can be used to reset this

brew unpin <formula>

To view all pinned formulae

brew list --pinned

Note: brew upgrade will not upgrade pinned formulae.

Solution 3 - Homebrew

You could upgrade erlang to the latest version but keep using the older working version with the brew commands versions and switch.

To list available versions use:

brew versions erlang

To switch between two installed versions (I'll presume you wanted erlang R14):

brew switch erlang R14B04

Solution 4 - Homebrew

i had a similar 'problem'. i installed libfreenect (unstable) directly on my system. and now i dont want homebrew to upgrade it. i solved it by deleting following file:

/usr/local/Library/Formula/libfreenect.rb

analogous it would be /usr/local/Library/Formula/erlang.rb for you

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionpangratzView Question on Stackoverflow
Solution 1 - HomebrewpangratzView Answer on Stackoverflow
Solution 2 - HomebrewKhurram RazaView Answer on Stackoverflow
Solution 3 - HomebreweaglefloView Answer on Stackoverflow
Solution 4 - HomebrewtienbuiDEView Answer on Stackoverflow