Skip to content

Instantly share code, notes, and snippets.

@fionn
Last active October 7, 2020 09:23
Show Gist options
  • Save fionn/a78a2c15e27b4cd64f835bd29166d388 to your computer and use it in GitHub Desktop.
Save fionn/a78a2c15e27b4cd64f835bd29166d388 to your computer and use it in GitHub Desktop.
How to downgrade a Homebrew package in 2020

Make a GitHub repository that conforms to the naming scheme $username/homebrew-$tapname. It can be empty or already exist, it doesn't matter.

Get the formula at the version you want with brew extract $package $username/homebrew-$tapname --version=$version

This will automatically tap your tap, but if you want to add this to another machine, you'll have to:

  • commit and push your changes from the $(brew --prefix)/Homebrew/Library/Taps/$username/ directory,
  • brew tap $username/$tapname from the machine you want to add the tap to.

To install, brew install $package@$version. This will produce a bunch of errors, which is expected because the links will conflict with the already installed newer package. Override them with brew link --override $package@$version.

To get the latest version back, brew unlink $package && brew unlink $package@$version && brew link $package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment