There are a few ways to install Hugo on Ubuntu/Linux
- Snap (too troublesome with dependency and some issues)
- apt-get (easy, but might not have the latest version)
- Download and install Hugo package (mights sounds troublesome, but I think it's the most reliable method)
Download Hugo package
Visit Hugo release page to find the latest stable release (look under Downloads).
Use the following command to check your server machine achitecture
uname -i# outputx86_64Download the latest version for the correct platform and architecture (select .deb file)
wget https://github.com/gohugoio/hugo/releases/download/v0.25.1/hugo_0.25.1_Linux-64bit.debInstall Hugo package
Install the package with dpkg
sudo dpkg -i hugo*.debCheck if installation is successful by checking its version
hugo version# outputHugo Static Site Generator v0.25.1 linux/amd64 BuildDate: 2017-07-10T14:58:07+08:00Install the Pygments Syntax Highlighter
You should install Pygments if you need server-side syntax highlighting of code block in your website.
sudo apt-get install python-pipsudo pip install Pygments