Install specific version of kubernetes-helm

How can I install a specific version of kubernetes-helm? I can’t use version 3. I have tried:

iMac ➜  ~ brew install kubernetes-helm@2.16.1
Error: No available formula with the name "kubernetes-helm@2.16.1"
==> 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.
1 Like

This is not something that is supported by homebrew in general. https://docs.brew.sh/Manpage#extract-options-formula-tap could work for you though

You can install latest v2 like this brew install helm@2

@igas I tried that, but did not work.

iMac ➜  ~ brew install kubernetes-helm@2
Updating Homebrew...
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics

==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
samurai
==> Updated Formulae
imagemagick ✔      blastem            deno               futhark            icecream           pandoc             sbcl               vert.x
tmux ✔             calceph            dnscrypt-proxy     git-cola           jfrog-cli-go       pulumi             smali              yadm
ballerina          cfn-lint           exploitdb          gnupg              maven              rke                swiftformat
bazel              consul             fauna-shell        hugo               nushell            rom-tools          teleport

Error: No available formula with the name "kubernetes-helm@2"
==> 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

Actually, doing:

brew install helm@2

Did work. I also had to manually do:

brew link --force helm@2
4 Likes

In case you need to install a specific version, let’s say 2.14.3 and not the latest of helm2, then I suggest doing the following:

  1. search the github repo of homebrew for the commit mentioning the version you need;
  2. click “view file” -> click “raw”, copy the URL;
  3. now in your terminal do brew install <URL>

For example, your command to install 2.14.3 will look like:
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/0a17b8e50963de12e8ab3de22e53fccddbe8a226/Formula/kubernetes-helm.rb

Notes:
if you have a newer version of the same app, the link step will fail and you’ll need to manually create a symlink.

I’d advise against doing that since there is a reasonable chance that it’ll break any formula that depends on it in some form. A better solution is to create a tap and use brew extract to get the version you want into your own tap. That way it can exist seperate from all other dependencies.