How to install an older version of the Homebrew package

Using Homebrew to install older versions of certain packages may be more complicated than you might expect

I ran into this problem: I updated Hugo, which is the CMS I use, and one of the versions that is newer than the version I use introduced major changes.

My homepage no longer lists blog posts. I don't have time to figure it outwhy, So I said "I will roll back".

Now the question becomes... "What's the matter?"

First, I uninstalled Hugo:

brew unlink hugo

Then I followed the instructions I foundThis post. I had to look for the recipe of the Hugo baghttps://github.com/Homebrew/homebrew-core/search?utf8=%E2%9C%93&q=hugo&type=Then I clicked on the file (Formula/hugo.rb), and then click the "History" button to view all previous versions.

Navigate to the 0.53 version I want and click<>Button to viewhomebrew-coreThe repository at the time. Then i openFormula/hugo.rbFile and clickRawGet the direct URL of the file.

I then use it as a parameterbrew install. E.g:

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

That's it.

The next step in solving the problem I encountered was to uninstall the currently installed version and try to update one version at a time so that I could isolate the release that introduced the changes that caused my problem.