Installing old Homebrew formulas

Josua Schmid
Jan 11, 2019 · 2 min read

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.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store