viu: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found
Got this error on Ubuntu 18.04, using https://github.com/atanunq/viu/releases/download/v1.3.0/viu
viu: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by viu)
Attempt to fix with, but didn’t work:
apt install -y libc6 libc-bin
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 13
- Comments: 23 (1 by maintainers)
Unfortunately, there is no best practice. If you want a statically compiled binary, you can compile against musl. I was able to do so and get it to run successfully:
and then copy the resulting binary. A one-liner of the above which will output it under
/tmp
:and to verify:
If you would prefer to build against older GLIBC versions and setup your CI/CD pipeline to do so, you can check out this blog post
1, compile glibc-2.33 to libc-2.33.so, http://ftp.gnu.org/gnu/libc/glibc-2.33.tar.gz 2. then link libc.so.6 to libc-2.33.so may solve it.
Anyone who gets that error should upgrade his Linux system or use a newer version of the particular Docker image’s base image.
I think this has to do with the way I create the release binary because I compile it locally on a very up-to-date Manjaro Linux. However, I’m not aware of the Rust best practices around this.
If anyone is, please share so that the release process can be improved and work for all of us 😃
This one-liner builds a static version with musl:
docker run --rm --name rust -v /tmp:/tmp -ti rust bash -c "apt update && apt -y install musl-tools && git clone https://github.com/atanunq/viu && cd viu && rustup target add x86_64-unknown-linux-musl && cargo build --target x86_64-unknown-linux-musl --release && cp target/x86_64-unknown-linux-musl/release/viu /tmp/viu"
I encounter the same problem of
/lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.32' not found
as I try tocargo build --release
of actix-web.Same issue here. Building for arm64 throws this error at the end, complaining about glibc 2.32.