Hugo installed with a snap doesn't work

Hi @surveyor3!

Sadly when I write hugo on the terminal it doesn’t work as if the software isn’t installed. Am I the only one to have this problem? Did I mistake something?
It seem to work just if I write in terminal “snap run hugo”.

Sorry for my late reply! Were you able to solve your problem?

If "snap run hugo" works for you, but plain "hugo" doesn’t, it means that you have multiple copies of the hugo binary installed on your system.

Please try the following command:

whereis hugo

And you might see something like this:

hugo: /usr/local/bin/hugo /snap/bin/hugo

which means there is another, likely older, copy of Hugo installed under /usr/local/bin.

Why does snap run hugo work? snap run forces running the binary inside /snap/bin.

Try these commands also:

$ hugo env
$ snap run hugo env

and you’ll likely see different outputs, e.g.:

$ hugo env
Hugo Static Site Generator v0.20.7 linux/amd64 BuildDate: 2017-05-03T01:39:25-06:00
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.8.1"

$ snap run hugo env
Hugo Static Site Generator v0.21 linux/amd64 BuildDate: 2017-05-24T14:12:22-06:00
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.8.1"

In my case, I have an older hugo .deb installed, so what I would do on my own system is to run

$ sudo dpkg --purge hugo

to get rid of the old copy.

Alternatively, you may also fetch the latest .deb package from Releases · gohugoio/hugo · GitHub

Hope this helps!

Anthony