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 either need an older version of the OS or a more recent version of the software you are trying to run. In my case I had to switch from Ubuntu 22.04 to Ubuntu 20.04.
Hi everyone, this is just a brief post, since I’ve just 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.
What happened?
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 went from 2.31 to 2.33.
From my understanding, GLIBC is compiled or somehow embedded straight into the Operating System (Ubuntu in my case) so it’s really hard to change or upgrade it, more over if you are running it on a automated system such as a CI.
How to fix it?
The only way to fix this error is by matching the GLIBC provided on by your OS and the one required by the software you want to run. So you can either use an older version of the OS or a more recent version of the software you are trying to run.
For example in my case I fixed the error by going from ubuntu-latest
to 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.
If you have any question or you some alternative ways to fix this error I’d like to update this post with your solutions. Feel free to reach me out on one of my socials.