Install old version (0.64.1 extended) of Hugo with Brew

Hi,

I spent ages trying to work out how to install an old version of Hugo. Hopefully this is helpful to someone else.

Scenario - Old website was on hugo 0.64.1 extended. Now I have a new computer with Ubunut 20.04 which I want to use to upgrade the website.

How To Upgrade

  • If I try to simple use brew install hugo I get the 0.76 latest and greatest. But the blog does not work on this version.
  • Check which version of hugo you use? In my setup this was in my pages.yml (we use github actions for our hugo deployment). This was worked out to be 0.64.1 extended.
  • Can’t find it in the releases, and don’t want to install from tarball etc anyways.
  • snap and brew are intended to be used for latest versions. Googling around, found this article - https://www.fernandomc.com/posts/brew-install-legacy-hugo-site-generator/
  • The article wants me to use below, but this does not work anymore as brew does not let you simply use the formula from way back in the day directly.

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/05968351ccd837965b3659bc42398c3bb8cae679/Formula/hugo.rb

Solution

Use the same as above, but download the hugo.rb file onto your local and then simply use brew install hugo.rb. Explicitly, here hugo.rb is the downloaded version of the homebrew formula file which referenced the original 0.64.1 extended.

This was super annoying so hopefully it helps someone else out.

5 Likes