Hugo Extended 0.104.3 for Uberspace.de / CentOS 7
To create fryboyter.de I use Hugo. And for webspace I use uberspace.de. For example, when I write a new article, I create a commit for it, which I upload to a Mercurial repository on the webspace. Each new commit then triggers the execution of a script that rebuilds the page.
The script uses the compiled version of Hugo provided by the developers which is stored on the webspace. Due to recent changes to the website I now need the so called extended version of Hugo. But unfortunately it doesn’t work at Uberspace.de, because they currently use CentOS 7, so some needed packages are too stable. Or in other words too outdated. Hugo therefore aborts with the following error message.
/home/laythos/bin/hugo: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/laythos/bin/hugo) /home/laythos/bin/hugo: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/laythos/bin/hugo) /home/laythos/bin/hugo: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/laythos/bin/hugo)
The problem is known to the developers (https://github.com/gohugoio/hugo/issues/9330), but for understandable reasons no ready compiled versions are offered for old distributions.
So in this case there are two possibilities. One creates the web page locally each time and loads it for example with rsync on the web space. Or you compile a version of Hugo that supports CentOS 7. I decided for the latter.
Compiling directly on an Uberspace should not be tried though. Because there you can use a maximum of 1.5 GB RAM. Anything that needs more will be terminated automatically. Which is the case with Hugo.
So I downloaded a virtual environment of CentOS 7 from https://www.osboxes.org and started it with VirtualBox. Then I installed golang as well as gcc-c++. The former via detours, since Go is apparently not available in the official package sources.
After that I proceeded as follows.
wget https://github.com/gohugoio/hugo/archive/refs/tags/v0.97.3.zip unzip https://github.com/gohugoio/hugo/archive/refs/tags/v0.97.3.zip cd hugo-0.97.3 CGO_ENABLED=1 go install --tags extended
The first command downloads the source code of the current version. The second command unpacks it. The third command changes to the directory where the files were unpacked. And the last command compiles the extended version of Hugo.
When the last command has been successfully executed, which can take a few minutes depending on your hardware, you should find the file hugo in the directory ~/go/bin/. You simply copy this file to your Uberspace. With this the creation of the website should work without error messages.
At https://e1.pcloud.link/publink/show?code=kZSMfzZx0nn3yYPAEVOyuhqvPPdgLfvF5ek I uploaded the current version of Hugo that works at Uberspace.de. If you want (and trust me), you can use it.
Version 0.104.3 created and uploaded by Hugo for Uberspcae / CentOS 7.
These articles could also be interesting:
- Install specific version of Composer at Uberspace
- Insert notices in articles under Hugo
- Hugo - Remove content from sitemap
- Some articles are now offered in multiple languages
- Update Hugo