Péha
Péha

Reputation: 2933

How to prevent homebrew from upgrading a package?

I'm wondering if there's any means to prevent Homebrew from upgrading a particular package ? Yesterday I went for a brew upgrade which updated the lua package from 5.1 to 5.2. It broke one of the projects I'm working on those days so I had to downgrade the lua package today when I noticed it.

I'd like this not to happen again, and I guess Homebrew must provide this kind of feature, but I didn't find anything about it in the documentation. Do you have any clue ?

Upvotes: 47

Views: 11904

Answers (3)

Br.Bill
Br.Bill

Reputation: 691

brew pin formula works well, but it's not currently possible to pin casks.

I need to prevent upgrade of a particular cask, so I use a filter to ignore that cask when upgrading:

brew update
brew upgrade --cask `brew outdated --cask | awk '{print $1}' | grep -v cask-to-skip`

Upvotes: 4

eli chan
eli chan

Reputation: 21

To complete the story, for my case using opencv as an example, it means that

brew -v edit opencv3
brew -v fetch --deps opencv3
brew -v install --build-from-source opencv3
brew pin opencv3

Upvotes: 0

Tim Smith
Tim Smith

Reputation: 6339

brew pin someformula.

There is also a lua51 formula now.

Upvotes: 66

Related Questions