--- Compile hugo extended on CentOS 8 Stream ---
Requieres new git version. git 1.8.3.1 as on CentOS 7.6.1810 doesn't work. CentOS Stream release 8 comes with git version 2.27.0 which is working ok.
[root@bacon hugo-master]# git --version
git version 2.27.0
[root@bacon hugo-master]#
To make it easier for others, to do so, just:
- install golang + gcc-c++ on your CentOS 7
- download https://github.com/gohugoio/hugo/archive/v0.54.0.tar.gz
- execute in the source directory go install -tags extended
- grab the result binary in your ~/go directory
# go install -tags extended
go: downloading github.com/google/go-cmp v0.5.4
tpl/internal/go_templates/texttemplate/helper.go:11:2: package io/fs is not in GOROOT (/usr/lib/golang/src/io/fs)
[root@bacon hugo-master]# go version
go version go1.15.7 linux/amd64
[root@bacon hugo-master]#
[root@bacon go]# go get golang.org/dl/go1.16.2
[root@bacon go]# ./bin/go1.16.2 version
go1.16.2: not downloaded. Run 'go1.16.2 download' to install to /root/sdk/go1.16.2
[root@bacon go]# ./bin/go1.16.2 download
Downloaded 0.0% ( 16384 / 129010536 bytes) ...
Downloaded 8.1% ( 10501008 / 129010536 bytes) ...
Downloaded 17.2% ( 22166416 / 129010536 bytes) ...
Downloaded 26.2% ( 33831824 / 129010536 bytes) ...
Downloaded 35.3% ( 45530000 / 129010536 bytes) ...
Downloaded 43.1% ( 55622544 / 129010536 bytes) ...
Downloaded 49.4% ( 63750144 / 129010536 bytes) ...
Downloaded 58.5% ( 75431936 / 129010536 bytes) ...
Downloaded 67.5% ( 87097344 / 129010536 bytes) ...
Downloaded 76.6% ( 98762752 / 129010536 bytes) ...
Downloaded 85.5% (110273431 / 129010536 bytes) ...
Downloaded 93.6% (120759191 / 129010536 bytes) ...
Downloaded 100.0% (129010536 / 129010536 bytes)
Unpacking /root/sdk/go1.16.2/go1.16.2.linux-amd64.tar.gz ...
Success. You may now run 'go1.16.2'
[root@bacon go]#
[root@bacon bin]# pwd
/root/sdk/go1.16.2/bin
[root@bacon bin]# ./go version
go version go1.16.2 linux/amd64
[root@bacon bin]#
[root@bacon hugo-master]# ../../sdk/go1.16.2/bin/go version
go version go1.16.2 linux/amd64
[root@bacon hugo-master]# ../../sdk/go1.16.2/bin/go install -tags extended
go build github.com/bep/golibsass/internal/libsass: g++: exec: "g++": executable file not found in $PATH
[root@bacon hugo-master]#
[root@bacon hugo-master]#
[root@bacon hugo-master]# yum install -y gcc-c++
Installed:
gcc-c++-8.4.1-1.el8.x86_64 libstdc++-devel-8.4.1-1.el8.x86_64
Complete!
[root@bacon hugo-master]# ../../sdk/go1.16.2/bin/go install -tags extended
[root@bacon hugo-master]#
[root@bacon go1.16.2]# which hugo
/usr/bin/which: no hugo in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/root/sdk/go1.16.2/bin)
[root@bacon go1.16.2]# find / -name hugo
/root/tmp/hugo-master/common/hugo
/root/tmp/hugo-master/tpl/hugo
/root/go/bin/hugo
[root@bacon go1.16.2]#
[root@bacon go1.16.2]# /root/go/bin/hugo version
hugo v0.82.0-DEV+extended linux/amd64 BuildDate=unknown
[root@bacon go1.16.2]#
[root@bacon ~]# cp /root/go/bin/hugo /usr/local/bin/
[root@bacon ~]# ll /usr/local/bin/hugo
-rwxr-xr-x. 1 root root 73155984 Mar 13 15:15 /usr/local/bin/hugo
[root@bacon ~]#
See also