Hugo 错误 - 当前主题不支持当前版本

Hugo Error - Current theme does not support current version

我正在尝试构建我的 hugo 站点,但是当我 运行 hugo check 我看到以下错误日志:

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"

它说我需要 Hugo 版本 0.18 但是当我 运行 sudo apt-get install hugo 它告诉我:

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

所以我对为什么会收到错误感到困惑。有人 运行 遇到过这个错误吗?知道我该如何解决吗?

如果您没有使用 apt 获取最新版本的 Hugo,那么您应该尝试直接从 Github repository 下载它。单击最新版本(或您需要的任何版本)。进入发布页面后,向下滚动到“下载”部分,然后通过单击或使用 wget 下载压缩文件来下载文件。然后解压文件,运行./hugo version确认版本

Ubuntu 的主要下载库由 Canonical 维护,对于 GoHugo 的最新版本它们已经过时。因此,sudo apt upgrade hugo 不会有太大帮助。即使是现在,hugo 的最新版本是 8 月的 0.48,但 apt 只给我 0.40 截至 4 月的过时。

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.