Skip to content

Instantly share code, notes, and snippets.

@modille
Created December 20, 2018 18:18
Show Gist options
  • Save modille/b43af3f895a6001152bb337cd0b3c99b to your computer and use it in GitHub Desktop.
Save modille/b43af3f895a6001152bb337cd0b3c99b to your computer and use it in GitHub Desktop.
Install and pin an older version of a homebrew formula
# Find and install an OLD version of a homebrew formula
# and PIN it to prevent upgrading.
# Choose formula
formula=kubernetes-cli
# View homebrew-core git log to find a commit
git clone [email protected]:Homebrew/homebrew-core.git
cd homebrew-core
git log master -- "Formula/$formula.rb"
# Choose commit
sha=41764e07727d9a86b0f8a077117dc7876ca294c4
# Re-install from URL
brew remove $formula
brew install "https://raw.githubusercontent.com/Homebrew/homebrew-core/$sha/Formula/$formula.rb"
# Pin the formula to prevent it from being upgraded
brew pin $formula
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment