I wrote this article while installing go on WSL.
$ curl https://dl.google.com/go/go1.15.5.linux-amd64.tar.gz -o golang.tar.gz
$ sudo tar -C /usr/local -xzf golang.tar.gz
$ vim ~/.bashrc
## Add /usr/local/go/bin/ to path
## export PATH=/usr/local/go/bin:$PATH
$ source ~/.bashrc
## Check
$ go version
go version go1.15.5 linux/amd64
Just delete the current version like rm -rf /usr/local/go
, and replace it with new version.
GCC and G++ are required (sudo apt install gcc g++
).
$ cd /usr/local/go/src
$ sudo git clone https://github.com/gohugoio/hugo.git
$ cd hugo
$ sudo env "PATH=$PATH" go install --tags extended
## Check
$ hugo version
Hugo Static Site Generator v0.79.0-DEV/extended linux/amd64 BuildDate: unknown