Skip to Content

Install an older version of a Homebrew package

Posted on

Problem

My hugo blog use a custom theme, which is not supported by newest hugo version. But when I use command brew install hugo, it’s always newest version (0.69).

Solution

1. Step 1

brew unlink hugo

or

brew uninstall hugo

2. Step 2

Go to Homebrew-core repo on Github, and search for your app, in my case is hugo + version. (hugo 0.59)

After that, open commits result.

3. Step 3

Take hash commit: 6feb9c77f8b803409d31cbe633201fe3a1b15cd4 - It’s commit which hugo version 0.59 is changed.

4. Step 4

Install with format: brew install raw_file

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/6feb9c77f8b803409d31cbe633201fe3a1b15cd4/Formula/hugo.rb
comments powered by Disqus