Specifically
kubernetes-cli. I have 1.12.0 installed. I need 1.11.x, but I don't have that installed.
I've reviewed and tried every answer in this thread and nothing worked: https://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula
I've tried
brew search but there are no tapped versions:
~ brew search kubernetes-cli
==> Formulae
kubernetes-cli ✔
I've tried
brew versions but that command has been removed:
~ brew versions Error: Unknown command: versions
I've tried
brew install kubernetes-cli@1.11.0 and .1 and .2:
~ brew install kubernetes-cli@1.11.0
Error: No available formula with the name "kubernetes-cli@1.11.0"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
brew switch requires that I have the older version installed, which I don't.
~ brew switch kubernetes-cli 1.11.0 Error: kubernetes-cli does not have a version "1.11.0" in the Cellar. kubernetes-cli installed versions: 1.12.0
Formula folderkubernetes-cli.rb filehttps://raw.githubusercontent.com/Homebrew/homebrew-core/3e8f5503dde7069c5ff49b82d5e1576e6ebe3a5d/Formula/kubernetes-cli.rbbrew install <raw_link>I dont have enough rep to make a comment on the answer that helped me. So writing here to be more specific about point 2 from @urpalreloaded
brew search --pull-request kubernetes-cli@1.11.0brew unlink kubernetes-clibrew install <raw-link>FWIW, I think brew doesnt keep versions because it will make the repo too big? This workaround is inconvenient and perhaps they could find a way around this issue on their end?
The above answers were really useful but when I tried to install Carthage 0.30.1 on my Sierra 10.12.6 machine I got a SHA256 mismatch error:
$ brew install https://raw.githubusercontent.com/ilovezfs/homebrew-core/8c93668a451087611b2247cafe02ad6f867daed6/Formula/carthage.rb --force-bottle
######################################################################## 100.0%
Warning: carthage 0.32.0 is available and more recent than version 0.30.1.
==> Downloading https://homebrew.bintray.com/bottles/carthage-0.30.1.sierra.bottle.tar.gz
######################################################################## 100.0%
Error: SHA256 mismatch
and then it failed to build from source due to latest Sierra Xcode not supporting the new Xcode build system.
What worked for me was to directly install from the bottle (the url is shown in first
brew install <raw url> output):
brew install https://homebrew.bintray.com/bottles/carthage-0.30.1.sierra.bottle.tar.gz
For
kubernetes-cli specifically (and if you don't care about patch versions - the x in 1.11.x), you can just use:
brew install kubernetes-cli@1.11
And it will complete with the latest
x available.I have the same problem as dsjapan and what worked for me was changing to high sierra:
brew unlink carthage
brew install https://homebrew.bintray.com/bottles/carthage-0.30.1.high_sierra.bottle.tar.gz
As of Apr 2022:
The easiest way I found was to create a new tap.
I figured out how to both upgrade and downgrade any formula that's been disabled due to deprecation.
(basically I followed this guide and set an additional brew environment variable)
In my case I did the following to upgrade from 1.22.16 to 1.22.17 (latest before deprecation):
brew edit kubernetes-cli@1.22
disable! date:# disable! date: "2022-10-28", because: :deprecated_upstream
HOMEBREW_NO_INSTALL_FROM_API=1 brew upgrade kubernetes-cli@1.22
To roll back or generally install any other version, continue with these steps instead:
... -> View file) or:brew log kubernetes-cli@1.22
HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall kubernetes-cli@1.22
Here's how I installed older version of kubectl (1.27.4):
brew unlink kubernetes-cli brew tap-new $USER/local-kubernetes-cli brew extract --version=1.27.4 kubernetes-cli $USER/local-kubernetes-cli brew install kubernetes-cli@1.27.4
The installation took several minutes and during it I've encountered an error about
md5sha1sum being locked and thus, kubectl can't be installed, because the package needs to be downgraded.
Fixed with the following command:
brew unlink md5sha1sum
Thanks to yuser bertonc96 for the link to the guide.