Installing old Homebrew formulas

Homebrew is a handy package manager for Mac OSX. You can easily install software the “apt-get install”-way by executing short commands in your terminal, like brew install kubernetes-helm. Updating then happens with brew upgrade kubernetes-helm.

Now, what if I want to install a certain specific version of a package? If the version is not provided by the newest formula (installable for example via brew install qt@5.5), there’s no obvious way to do so. If you read a bit about the command line synopsis you’ll find out, that you cannot only install packages via the official formulas but also by supplying a formula URL directly to the install command.

So you can actually look for the old formula at the official Homebrew formula repository on Github (or somewhere else) and install it directly via:

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/baac18f6c73c6a8dd229683fb0945aebc30a37e7/Formula/kubernetes-helm.rb

Once installed you can easily switch the used version to the one you want to use locally:

brew switch kubernetes-helm 2.9.1

And pin it, so that it doesn’t get updated when you type brew update (which updates everything):

brew pin kubernetes-helm

Be careful with pinning

You may miss updates…

Generally be careful with using outdated formulae. They’re outdated for a reason. There could well be security flaws with the version you pinned.