Download latest *.deb and use dpkg.
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 # output x86_64
Download the latest version for the correct platform and architecture (select .deb file)
Install Hugo package
Install the package with dpkg
sudo dpkg -i hugo*.deb
Check if installation is successful by checking its version
hugo version # output Hugo Static Site Generator v0.25.1 linux/amd64 BuildDate: 2017-07-10T14:58:07+08:00
Install 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-pip sudo pip install Pygments