kubernetes-cli
(v1.10.3) taken as example
- Downgrade Homebrew to the commit which upgrades the formula to the specific version that we want
$ cd "$(brew --repo homebrew/core)"
$ git log Formula/kubernetes-cli.rb
...
commit 0c1a8d9cab85af1a1e519071b40fd254a8a27265
Author: BrewTestBot <[email protected]>
Date: Wed Jun 6 00:54:22 2018 +0000
kubernetes-cli: update 1.10.3 bottle.
commit 8f44eaa38a71df4a25823f79d9da96fa58fc51fa
Author: Ronny Haryanto <[email protected]>
Date: Wed Jun 6 09:48:45 2018 +1000
kubernetes-cli 1.10.3
Closes #28693.
Signed-off-by: ilovezfs <[email protected]>
...
$ git checkout -b kubernetes-cli-1.10.3 0c1a8d9cab85af1a1e519071b40fd254a8a27265
- Unlink, in case we already have a version installed
$ brew unlink kubernetes-cli
- Install and force Homebrew not to update itself and the list of formulae
$ HOMEBREW_NO_AUTO_UPDATE=1 brew install kubernetes-cli
- Pin the formula to prevent Homebrew from updating it
$ brew pin kubernetes-cli
- After installation, the version specified is automatically linked
$ brew info kubernetes-cli
kubernetes-cli: stable 1.11.0 (bottled), HEAD [pinned at 1.10.3]
Kubernetes command-line interface
https://kubernetes.io/
/usr/local/Cellar/kubernetes-cli/1.10.3 (178 files, 52.8MB) *
Poured from bottle on 2018-07-11 at 16:22:16
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/kubernetes-cli.rb
==> Dependencies
Build: go ✔
==> Options
--HEAD
Install HEAD version
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions have been installed to:
/usr/local/share/zsh/site-functions
- Cleanup
$ git checkout master
$ git branch -d kubernetes-cli-1.10.3
$ brew cleanup && brew prune
Credits: Zoltan Altfatter