ptnega's technical blog

How to install Hugo on Linux and Windows

on December 28, 2015

In this tutorial, I will show you how to properly install Hugo on your machine.

1. Installation on a Linux machine

  • Debian: In this section, I use my Ubuntu 15.10 64-bit as an example:

First, I need to download the appropirate package file from here:

https://github.com/spf13/hugo/releases

The file I need is hugo_0.15_amd64.deb since my system is 64-bit. If you use a 32-bit system, you will need hugo_0.15_i386.deb

Now I’ve got the package file in ~/Download/ on my machine. Navigate to this directory and use dpkg to simply install Hugo

cd ~/Downloads/

sudo dpkg -i hugo_0.15_amd64.deb

Screenshot from 2015-12-28 12-53-58

You might encounter problems about dependencies. The following command might help you:

sudo apt-get -f install

It will fix the issues of your installation and then install the package for you.

  • Arch Linux:

If you use Arch Linux, it’s quite easy to install Hugo since Hugo is available in yaourt

If you haven’t installed yaourt, add the following lines to /etc/pacman.conf:

[archlinuxfr]

SigLevel = Never

Server = http://repo.archlinux.fr/$arch

and run this command to install yaourt:

pacman -Sy yaourt

To install Hugo using yaourt, simply use this command:

yaourt hugo

You will be prompted to provide your password and everything will go in the right way.

In the end, you should be able to use hugo in your command line shell using the command hugo

 2. Installation on Windows

Depending on your system architecture – 32 bit or 64 bit – you need the correct setup file. I use my Windows 10 32-bit system as an example, so I’ll need hugo_0.15_windows_386_32-bit-only.zip

Those who use 64-bit Windows system should get hugo_0.15_windows_amd64.zip for installation.

When you’ve done downloading the setup file, extract it. Now you’re gonna add the directory of Hugo to PATH Environment variable so you can use Hugo everywhere on your system using CMD

Open Advanced system settings (This window usually appear when you right-click on My Computer and click on Properties):

2015-12-28 (1)

Click on Environment Variables:

2015-12-28 (2)

Now you should add a new variable for your user or modify the system variable. The variable to be created is PATH and the value of it is the path to the directory which contains the extracted files from the previous step. Note that values are separated by the semicolon (;) :

2015-12-28 (3)

2015-12-28 (4)

I’ve renamed the executeable file in the archive to hugo.exe for simple usage. Now I can use Hugo by typing hugo.exe <option> <params> wherever I want:

2015-12-28 (5)

If you have any problems during the installation, feel free to leave a comment in this post and I will answer as soon as possible.


One response to “How to install Hugo on Linux and Windows

  1. […] How to setup a blog using Hugo How to install Hugo on Linux and Windows » Dec […]

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: