❄️ Installing Older Versions of `hugo`
Installing a previous version of hugo
via brew
is not as easy as installing the latest version.
Steps
- Clone the latest repository of the software that you require. I need an older version of
hugo
and it usesgo
so I will be building that from source.
git clone git@github.com:gohugoio/hugo.git
- Navigate to the directory
cd hugo
- Checkout to the version of
hugo
that you require e.g. versionv0.113.0
is atSHA5
of085c1b3d614e23d218ebf9daad909deaa2390c9a
.
hugo checkout 085c1b3d614e23d218ebf9daad909deaa2390c9a
- Install
go
and build the package
# install go
brew install go
# build package from source
go build
- Copy
hugo
file to yourPATH
# On Mac
sudo cp hugo /usr/local/bin
- Assert that the installed version of
hugo
is the one you require.
hugo version
hugo v0.113.0-085c1b3d614e23d218ebf9daad909deaa2390c9a darwin/arm6
- Never touch it again.