Error /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
Asked Answered
D

6

49

firstly, I google'd a lot but nothing I found related to my case, I have an ELF executable file I'm trying to run it in my Ubuntu WSL, I've changed the permissions (chmod +x file), when I run it, this error shows up

/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by myFile)

and when I use ld command this shows up to me

myFile(.eh_frame); no .eh_frame_hdr table will be created

and when I tried to upgrade GLIBC it says it's up-do-date

Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6 is already the newest version (2.31-0ubuntu9.7).
libc6 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 215 not upgraded.

and then I tried manually installing the deb file from https://packages.ubuntu.com/impish/amd64/libc6/download but this shows up to me :

dpkg: regarding libc6_2.34-0ubuntu3.2_amd64.deb containing libc6:amd64:
 libc6:amd64 breaks fakeroot (<< 1.25.3-1.1ubuntu2~)
  fakeroot (version 1.24-1) is present and installed.

dpkg: error processing archive libc6_2.34-0ubuntu3.2_amd64.deb (--install):
 installing libc6:amd64 would break fakeroot, and
 deconfiguration is not permitted (--auto-deconfigure might help)
Errors were encountered while processing:
 libc6_2.34-0ubuntu3.2_amd64.deb
Dykstra answered 20/4, 2022 at 13:2 Comment(3)
GLIBC (libc6) is your OS (together with the kernel) and cannot be changed. ....... Suggest: Install Ubuntu 22.04 : Has libc6_2.35 .... (Which includes objects from previous versions : GLIBC_2.34 etc.)Microprint
Try to check this solution, it worked for meDisembody
The error you got means you have a version of GLIBC older than the required or you are using a non GLIBC distro(e.g. MUSL). Just update your version of glibc with your PM and all should be good. No need to install Ubuntu or any other distro unless there are no updates to your distro.Trifling
Y
24

I've got this error with buildroot-2022.11 when executing make.

Ubuntu 20.04 - added this repo as described in the link

sudo apt update
sudo apt install libc6

It automatically installed 2.35 for me.

Yea answered 24/1, 2023 at 9:58 Comment(3)
I needed this to install ghdl 3.0.0 on ubuntu 20.04 it seemed to do the trick.Zwickau
Confirm this works on WSL2 Ubuntu 20.04. Needed GLIBC 2.34+ for docker desktop.Upgrowth
It's not recommended to manually edit sources.list file as described in the link. It could result in breaking the package manager.Brno
S
12

DISCLAIMER: I am not a Linux professional, just found a way for my own problem with glibc not found error msg:

Maybe you cannot use the binary since it was compiled with gcc-11 and your gcc version of your Linux distribution and version only is gcc-9 and therefore only provides glibc_2.31 (I guess). You can try to compile the program yourself from source. I had to do this with the new stockfish version 15, which also uses updated glibc_2.32/2.33/2.34 and my linux-mint does not provide that. But compiling from source worked like a charm. Maybe this is an option for you.

Soupandfish answered 22/4, 2022 at 15:58 Comment(0)
E
11

In my case, replace FROM go:1.21 with FROM go:1.21.0-bullseye (docker) or try tinkering there.

Endicott answered 11/9, 2023 at 3:25 Comment(4)
This was exactly the elegant solution that I needed to fix my builds for a portable go binary. No other change was needed on my end other than switching the docker image. Much thanks!Renferd
Exactly something I was looking forCubbyhole
Lol funny how the original question didnt even mention Golang. I set my version to 1.21-bullseye and that fixed it for meZeringue
Lol, I just read the title.Endicott
A
2

I have some similar situation,

I copied my executed file from a CentOS VM1 to another CentOS VM2, then I got the same question, I just copy the source code to VM2,and recompile it, then the question is solved.

I got a makefile and a shell script to compile it, so the compilation process is simple, update glibc may cause other problem and is more complicated, and I am a caiji, hope to help u

Acquit answered 17/1, 2023 at 2:25 Comment(0)
R
2

I managed to compiled it with 3 parameters as follows, and it works for me. Actually, the OS version is Ubuntu 20.04, and GLIBC_2.35 is already installed.

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./app .
Recreate answered 21/2 at 6:49 Comment(0)
D
1

I had the same problem, it was an issue about the overwrite of the Environment Variable LD_LIBRARY_PATH. Try to check this solution

Disembody answered 9/5, 2023 at 7:37 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewEmilemile

© 2022 - 2024 — McMap. All rights reserved.