How to fix version GLIBC not found
TLDR: it depends on the OS you used to compilate the binary. The OS is more recent than the one you want to run the binary on, so you need an older version of the OS. For example I had to switch from Ubuntu 22.04 to Ubuntu 20.04.
Hi everyone, this is just a brief post, since I spent a few hours trying to figure out how to fix this error.
It happened while trying to compile a Rust binary using GitHub Actions on
ubuntu-latest that, at the time of this post, is running Ubuntu 22.04.
It successfully compiles the binary, but when I try to run it on the staging machine I get this error:
version GLIBC_2.33 not found
that is weird because one year ago the exact same code, compiled on
ubuntu-latest, worked flawlessly.
So, what changed? In the meantime the
ubuntu-latest version changed from 20.04 to 22.04, and the GLIBC version used by the OS changed from 2.31 to 2.33.
Finally, to fix this I had to switch from
ubuntu-20.04 in my GitHub Actions, and everything worked again.
Why writing this post?
I’m new in the Rust ecosystem and I though the problem was with the Rust version or with the Rust Toolchain, but it turns out that it was a problem with the OS. I couldn’t figure it out even if I found a few questions on Stack Overflow with the same error.
That’s all, hope this post will help you. If you have any questions, feel free to reach me out on one of my socials.