Ubuntu on Window and Hugo 0.105.0 via Brew: info[DT_RUNPATH] == NULL' failed! ... /bin/hugo: Bad address

Through my investigation I downloaded hugo_0.105.0_linux-amd64.tar.gz, unpacked it and run ./hugo version and it is working fine, hence there is no issue with Hugo itself (maybe Brew package?)

Interesting is that hugo command through Brew references to /home/linuxbrew/.linuxbrew/bin/brew where this is referencing to /home/linuxbrew/.linuxbrew/Cellar/hugo/0.105.0/bin/hugo

So, as unpacked from hugo_0.105.0_linux-amd64.tar.gz file hugo is executing correctly, I decided to overwrite hugo (delivered through brew) file with the extracted one.

The result when running hugo command is exactly the same.

-bash: /home/linuxbrew/.linuxbrew/bin/hugo: Bad address

Even if run ./hugo from /home/linuxbrew/.linuxbrew/Cellar/hugo/0.105.0/bin/ directly.

This looks like some kind of system-wide issue.

Then I found this information on Homebrew for Linux website which references to similar issue somehow.


Windows Subsystem for Linux (WSL) 1

Due to [known issues](https://github.com/microsoft/WSL/issues/8219) with WSL 1, you may experience issues running various executables installed by Homebrew. We recommend you switch to WSL 2 instead.

I removed WSL (which by default install WSL 1) and decided to install WSL 2 on Windows 10 according to Microsoft instruction which just refers to running one command from elevated Command Prompt (rather then adding feature from Control panel in Windows).

wsl.exe --install

I removed Ubuntu for Windows prior to that and after WSL 2 finished and the computer restarted I tried again.

By default WSL 2 install Ubuntu 20.04 (2004.2020.424.0) which I removed and installed Ubuntu 22.04.1 from Microsoft Store.

Following that, I installed Brew and then Hugo (in that case, because there was an update already, it installed 0.106.0).

An elevated command prompt is also shown running ubuntu in Version 2 (wsl -l -v).

This sorted the issue and Hugo run well.