Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hugo Error - Current theme does not support current version

I'm attempting to build my hugo site but when I run hugo check I see the following error log:

ERROR: 2017/09/10 Current theme does not support Hugo version 0.14. Minimum version required is 0.18
ERROR: 2017/09/10 template: theme/_default/baseof.html:2: function "default" not defined
ERROR: 2017/09/10 template: redefinition of template "main"
ERROR: 2017/09/10 template: theme/_default/single.html:7: function "humanize" not defined
ERROR: 2017/09/10 template: redefinition of template "main"
ERROR: 2017/09/10 template: theme/_default/terms.html:12: function "relLangURL" not defined
ERROR: 2017/09/10 template: theme/index.html:6: function "default" not defined
ERROR: 2017/09/10 template: theme/partials/menu-contextual.html:12: function "humanize" not defined
ERROR: 2017/09/10 template: theme/partials/page-header.html:9: function "default" not defined
ERROR: 2017/09/10 template: theme/partials/site-footer.html:4: function "now" not defined
ERROR: 2017/09/10 template: theme/partials/site-header.html:1: function "default" not defined
ERROR: 2017/09/10 template: theme/partials/social-follow.html:5: function "dict" not defined
ERROR: 2017/09/10 template: theme/partials/summary.html:3: function "humanize" not defined
ERROR: 2017/09/10 template: theme/post/single.html:11: function "humanize" not defined
ERROR: 2017/09/10 template: redefinition of template "main"

It says that I need Hugo version 0.18 but when I run sudo apt-get install hugo it tells me:

hugo is already the newest version
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.

So I'm confused as to why I'm getting the error. Has anyone run into this error? Know how I can fix it?

like image 945
sgmm Avatar asked Sep 10 '17 22:09

sgmm


2 Answers

Ubuntu's main download repos are maintained by Canonical, and they are outdated for GoHugo latest releases. Hence, sudo apt upgrade hugo will not be much of help. Even now, hugo latest release is 0.48 dated August but the apt gives me only upto 0.40 outdated as of April.

Always try to use sudo snap install hugo in Ubuntu for up-to-date experience with Go Hugo. Snaps are maintained and updated very well. So even if you miss manually to update your packages, it seamlessly updates in background within 12 hours of releases after arriving at Snap Stores.

Uninstall all the instances of Hugo and try fresh installation with snaps if possible because new versions always tend to leave support for some old configs. You can try verifying your needed hugo version using sudo snap search hugo which gives details of which latest version is available in snap store currently.

Or manually you could download the latest release link and update your version and finally check with sudo hugo version. You can also confirm its primary location in system by whereis hugo and replacing it with newer versions.

like image 173
sparsh Avatar answered Sep 27 '22 18:09

sparsh


If you're not getting the latest version of Hugo using apt then you should attempt to download it directly from the Github repository. Click on the latest release (or whichever version you need). Once you're on the release page, scroll down to the Downloads section and then download the file by clicking on it or by using wget download the compressed file. Then extract the file and run ./hugo version to confirm the version.

like image 38
Salah Assana Avatar answered Sep 27 '22 18:09

Salah Assana