How to install Go(lang) and Hugo on Ubuntu.

Install Go


Replace the https://… download URL below with the latest Linux AMD64 version listed at

cd $HOME
sudo curl -OL
sudo tar -C /usr/local -xzf $HOME/go1.9.1.linux-amd64.tar.gz
rm $HOME/go1.9.1.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
mkdir $HOME/go/bin -p
mkdir $HOME/go/pkg
mkdir $HOME/go/src
export PATH=$PATH:$HOME/go/bin

Install Hugo


The first three lines below creates a shell script which will download the latest version of Hugo, compile it with Go, and then install it in the Go bin directory.

The subsequent commands will mark the created script file as executable and then finally run that script.

echo "go get" >
echo "govendor get" >>
echo "go install" >>
chmod +x

To test that all is installed as expected, run the following commands and check that they don’t report a file not found error.

go version
hugo version