Hey folks, I abandoned my quest to build hugo on account of some personal life complexity. I’m coming back to try to ship the feature of adding time offsets to the youtube shortcode.
Again, though, I’m stymied building hugo from source. Per Linux | Hugo
git version 2.39.2
go version => go version go1.22.0 linux/amd64
gcc --version => $ gcc --version gcc (Debian 12.2.0-14) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
go: github.com/gohugoio/hugo@latest: GOPROXY list is not the empty string, but contains no entries
Huh. What if i set GOPROXY to empty string?
if [ -z "$GOPROXY" ]; then echo empty; fi
empty
Same thing. I can’t seem to get hugo built and, more importantly, get the test cases to run. My goal is to get a build to build and the extant test suite to run. Am I missing a configuration step?
I suspect your Go installation/config is… not what you want.
On a virgin Debian bookworm system I installed git, Go, and build-essential.
git version
# git version 2.39.2
go version
# go version go1.22.0 linux/amd64
gcc --version
# gcc (Debian 12.2.0-14) 12.2.0
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
No problems.
This is how I installed Go:
Add this section to $HOME/.bashrc:
# Set PATH to include $HOME/go/bin if it exists.
if [ -d "$HOME/go/bin" ]; then
PATH="$HOME/go/bin:$PATH"
fi
Install:
sudo snap install go --channel=1.22/stable --classic
Open a new console so that .bashrc is sourced again.
The one difference is that I don’t have snap installed … but i’m not sure I really want to install some other tool that I only dimly understand. AFAICT, installing go is:
expand the archive
move it into /usr/local
then put the bin subdir in your PATH
That’s fine, that’s easy. I do that nearly every day.
That’s also the instructions that I copied from Google. I don’t see what I could have messed up here to create this wild goose chase of an error.
I worked on this with a friend from work and he suggested that I unset GOROOT. Doing so stopped the error about GOPROXY. Why the heck a go env var situation should cause a complaint in GOPROXY is beyond me.