I’m trying to install Hugo on Red Hat Enterprise Linux release 8.10. Tried all package managers mentioned in official instruction and none of them worked for me. I succeeded with snap but this package is confined and it does not work with our current project. Now, I tried ‘sudo dnf install hugo’ and this does not work as well (I’ve followed this instruction). Any chance to get yum.gohugo.io working? Any other ideas how I can install Hugo on my system using binary package? I would prefer to have it easily upgardeable in the future.
Not likely in near future.
Have you tried to use Go to build/install it: GitHub - gohugoio/hugo: The world’s fastest framework for building websites. · GitHub
I’ve tried like this (need extended version):
CGO_ENABLED=0 go install -tags extended github.com/gohugoio/hugo@latest
And it fails with this message on end:
go: downloading ``github.com/josharian/intern`` v1.0.0
package ``github.com/gohugoio/hugo
imports ``github.com/gohugoio/hugo/commands
imports ``github.com/gohugoio/hugo/create
imports ``github.com/gohugoio/hugo/hugolib
imports ``github.com/gohugoio/hugo/tpl/tplimplinit
imports ``github.com/gohugoio/hugo/tpl/css
imports ``github.com/gohugoio/hugo/resources/resource_transformers/tocss/scss
imports ``github.com/bep/golibsass/libsass
imports ``github.com/bep/golibsass/internal/libsass:`` build constraints exclude all Go files in /home/qryfalk/go/pkg/mod/github.com/bep/golibsass@v1.2.0/internal/libsass
I guess I need to install Dart Sass somehow?
No you don’t need that to build Hugo.
What Go version do you use? (output of go version).
You need to enable CGO to install the extended edition:
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
See https://gohugo.io/installation/linux/#build-from-source.
Thanks a lot. I’ve finally managed to install Hugo using this command as a root (GOPATH is to install it to location available for all users on server):
GOPATH=/usr/local/hugo CGO_ENABLED=1 /usr/local/go/bin/go install -tags extended github.com/gohugoio/hugo@latest
It’s: go version go1.26.2 linux/amd64
Freshly installed it like this:
wget -4 https://go.dev/dl/go1.26.2.linux-amd64.tar.gz
sudo sh -c ‘rm -rf /usr/local/go && tar -C /usr/local -xzf go1.26.2.linux-amd64.tar.gz’