Field Note

Downgrading Brew Packages

homebrew package downgrade
Posted on Monday, April the 01, 2019
1 min read

Downgrading a package imported by Homebrew from version B to version A is possible with a slight hack.

Packages correspond to installation script which are hosted (and versioned) on the Homebrew’s Github repository.

The list of formulas is hosted via the Homebrew/homebrew-core GitHub repository.

Clicking on the installation file for a given package (e.g. kubernetes-cli.rb for the Kubernetes command line utility) and viewing the revision history by clicking on “History”, you can find out which prior versions can be installed. If we now click on the <> icon (titled “browse the repository at this point in the history”) of the entry for the desired revision, the navigation bar will contain the root path for the given revision. Adding /Formula/<package-name>.rb to this lets us view the installation file for the given revision and pressing “Raw” gives us the URL for the desired installation file: e.g.

https://raw.githubusercontent.com/Homebrew/homebrew-core/1827ebb2fe905c931deb283f7245eaf465c7cbbf/Formula/kubernetes-cli.rb

for kubernetes-cli version 1.13.4.

We can now install the package version using brew install:

  brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/1827ebb2fe905c931deb283f7245eaf465c7cbbf/Formula/kubernetes-cli.rb

Inspired by this blog post by Ben Pickles.

friedrichkurz.me

© 2025 Friedrich Kurz

Privacy Policy