Hugo Updates with Windows (SOLVED)


#1

I am just using command prompt
I installed hugo v0.32.2 with chocolatey & now I want to update to the latest v0.34.4

I ran choco upgrade hugo
I get: “hugo v0.32.2 is the latest version available based on your source(s).”

I download the latest from: https://github.com/gohugoio/hugo/releases and replaced files

I ran hugo version
I get: v0.32.2

Only if I cd to J:\Hugo\bin and run “hugo version” do I get “Hugo Static Site Generator v0.32.4 …”

I have added J:\Hugo\bin to path.

Why is this happening? and what is the best method for updates on Windows? I read the docs, and they are extensive for Macs but only mention installation on windows.

Thanks


#2

That’s because most of us around here are on a Mac or a Linux Distro.

Hopefully someone who uses Hugo on Windows can help you…

EDIT
Also you can send Pull Requests to improve the Hugo Docs. Since you are a Windows user your input would be very useful for others, once you figure out what the best update approach is for Hugo on your OS.


#3

It is unlikely that chocolatey places Hugo in the folder J:\Hugo\bin.


#4

That isn’t my point - I manually extracted the files to that folder as a work around

“choco upgrade hugo” should still work?


#5

choco uninstall or remove hugo will work.


#6

RTFM


#7

choco uninstall hugo

Chocolatey uninstalled 1/1 packages.

now when I run “hugo version” anywhere I get v0.34.4. Great thanks - DONE.

For the future though how do I update without going to the site, downloading, and moving the files myself.

I would like to do this from the cmd with little effort


#8

Hugo is a single executable file, it does not require installation. It’s enough just to download the file and place it in a convenient folder. And RTFM.


#9

Agree with @Mikhail 100% on this. Easier to just:

  • bring down the latest release zip file from GitHub
  • rename the old hugo.exe to it’s version for backup hugo_0.31.1.exe
  • copy in your new shiny version from the zip

Off to the races! (not much of a race, because Hugo beats them all every time)


#10

We would all love for Windows to act more unix-y (or POSIX-y, whatevs), but it ain’t. You can’t do many things from your terminal emulator as easily as non-Windows users.

If I had to use Windows, I’d probably run VirtualBox and a server GNU/Linux system. :slight_smile:


#11

Ironically, in the time you spend looking for a way to automate this and spend in this topic, you could probably do 7 or more manual Windows updates of Hugo. :wink:


I mean this in a friendly manner, not to critique your desire for an easier updating process on Windows. That might be a good idea for us Windows users.

But if I look at all actions I perform with Hugo and developing/maintaining websites, the time it takes to update Hugo is a tiny tiny fraction. So there’s little time to gain there. Perhaps a minute gained per Hugo update, so 10-15 minutes per year.