- Saved searches
- Use saved searches to filter your results more quickly
- /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32′ not found #68
- /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32′ not found #68
- Comments
- How do I install the Linux library libc.so.6 [SOLVED]
- Scenario-1: How do I install the library libc.so.6?
- Locate the package name of the library
- Install the missing library on Red Hat Linux
- Installation for 64-bit
- Installation for 32-bit
- Install the missing library on Debian Linux
- Installation for 64-bit
- Installation for 32-bit
- Scenario-2: Library is installed but LD_LIBRARY_PATH not configured
- Scenario-3: Proper library not installed as per your release version
- Summary
- Cannot find /lib/libc.so.6
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32′ not found #68
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32′ not found #68
Comments
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
The text was updated successfully, but these errors were encountered:
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 🙂
viu: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32′ not found (required by viu)
Same issue here. Building for arm64 throws this error at the end, complaining about glibc 2.32.
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:
docker pull rust docker run --rm --name rust -ti rust bash 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
and then copy the resulting binary. A one-liner of the above which will output it under /tmp :
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"
$ ldd /tmp/viu statically linked
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
How do I install the Linux library libc.so.6 [SOLVED]
Libc is a C library. Libc6 and glibc are the same version of libc. Libc6 is version 6 of the linux C Library and version 2 of the GNU C Library Many applications on Linux need this library.
On Red Hat based systems, this library is called glibc , while on Debian base systems it is called libc6 . In case this library is missing or not installed, then it possible you may face compilation related errors such as » library libc.so.6 not found or missing or no such file or directory «
There are 3 possible scenarios
- Library is not installed or missing
- The library path is not configured so the application is unable to locate the library file
- Library is installed for wrong ARCH i.e. your application may require 64-bit library but 32-bit library is installed
Scenario-1: How do I install the library libc.so.6?
Locate the package name of the library
First you need to know the package name required to install this library.
On Red Hat based systems you can use yum or dnf command. From the below output now you know the rpm responsible for installing 32-bit and 64-bit library.
~]# yum whatprovides */libc.so.6 glibc-2.28-151.el8.x86_64 : The GNU libc libraries Repo : @System Matched from: Filename : /lib64/libc.so.6 glibc-2.28-164.el8.i686 : The GNU libc libraries Repo : baseos Matched from: Filename : /lib/libc.so.6 glibc-2.28-164.el8.x86_64 : The GNU libc libraries Repo : baseos Matched from: Filename : /lib64/libc.so.6
On Ubuntu based distributions, there are multiple command line options as shown below:
$ sudo dpkg -S libc.so.6 libc6:amd64: /lib/x86_64-linux-gnu/libc.so.6
deepak@ubuntu:~$ sudo apt-file find libc.so.6 libc6: /lib/x86_64-linux-gnu/libc.so.6 libc6-amd64-cross: /usr/x86_64-linux-gnu/lib/libc.so.6 libc6-amd64-i386-cross: /usr/i686-linux-gnu/lib64/libc.so.6 libc6-amd64-x32-cross: /usr/x86_64-linux-gnux32/lib64/libc.so.6 libc6-arm64-cross: /usr/aarch64-linux-gnu/lib/libc.so.6 libc6-armel-cross: /usr/arm-linux-gnueabi/lib/libc.so.6 . libc6-x32-amd64-cross: /usr/x86_64-linux-gnu/libx32/libc.so.6 libc6-x32-cross: /usr/x86_64-linux-gnux32/lib/libc.so.6 libc6-x32-i386-cross: /usr/i686-linux-gnu/libx32/libc.so.6 libc6.1-alpha-cross: /usr/alpha-linux-gnu/lib/libc.so.6.1
or you can login to https://packages.ubuntu.com/ and search for your package:
Install the missing library on Red Hat Linux
Now that you know the package to be installed, go ahead and install it using package manager based on your distribution:
Installation for 64-bit
You can check the existence of the package on your system with the following command;
foc@fedora:~$ dnf list installed | grep glibc glibc.x86_64 2.34-35.fc35 @updates glibc-all-langpacks.x86_64 2.34-35.fc35 @updates glibc-common.x86_64 2.34-35.fc35 @updates glibc-devel.x86_64 2.34-35.fc35 @updates
If the package is not installed on your system, run the following commands in the terminal;
foc@fedora:~$ sudo dnf install glibc
The following command is sufficient to learn the location of the library after installation;
foc@fedora:~$ whereis libc.so.6 libc.so.6: /usr/lib64/libc.so.6
Installation for 32-bit
If your operating system is built on a 32 architecture or if the application you want to install requires 32 bit libraries, the following package should be installed;
foc@fedora:~$ sudo dnf install glibc.i686
Now let’s look at the locations of the glibc library again;
foc@fedora:~$ whereis libc.so.6 libc.so.6: /usr/lib/libc.so.6 /usr/lib64/libc.so.6
Now since we installed both 32-bit and 64-bit version of the library so it can be found under both /usr/lib and /usr/lib64 .
Install the missing library on Debian Linux
Installation for 64-bit
Package control is provided in Debian-based system with the following commands;
foc@foc:~$ dpkg -l | grep libc6 ii libc6:amd64 2.31-13+deb11u3 amd64 GNU C Library: Shared libraries ii libc6-dbg:amd64 2.31-13+deb11u3 amd64 GNU C Library: detached debugging symbols ii libc6-dev:amd64 2.31-13+deb11u3 amd64 GNU C Library: Development Libraries and Header Files
To install the 64-bit package;
foc@foc:~$ sudo apt install libc6
After this command, if the package is not installed, the installation starts with its dependencies.
Most distributions have this already installed. After these commands, the update information of the installed package is also learned. If it is in the old version, it will be upgraded.
To find out the location of the library, run the command below;
foc@foc:~$ whereis libc.so.6 libc.so: /usr/lib/x86_64-linux-gnu/libc.so /usr/lib/x86_64-linux-gnu/libc.so.6
Installation for 32-bit
To install the 32-bit package;
foc@foc:/$ sudo apt install libc6-i386
After package installation, the lib32 directory was created under the root directory (/);
foc@foc:/$ ls -la /lib32/libc.so.6 lrwxrwxrwx 1 root root 12 Mar 18 00:37 /lib32/libc.so.6 -> libc-2.31.so
Scenario-2: Library is installed but LD_LIBRARY_PATH not configured
Many software packages look out for LD_LIBRARY_PATH environment variable to search for shared libraries. Many times you will just copy the required library path to /usr/lib or any other path but then your application will not start consuming the library just because the file is there.
We need to use ldconfig [options] lib_dirs which will update the ld.so cache file with shared libraries specified on the command line in lib_dirs , in trusted directories /usr/lib and /lib , and in the directories found in /etc/ld.so.conf .
Once you have copied your library file to /usr/lib then just execute
ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf , and in the trusted directories ( /lib and /usr/lib ).
Next you need to append this path to LD_LIBRARY_PATH variable:
For non-persistent changes you can use export command which will be applicable only for your terminal
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/local/lib
For permanent changes you can place the above command in .bash_profile of individual user or just create a file inside /etc/profile.d/set-library-path.sh and add the above command. You can use any file name, set-library-path.sh is just an example.
Scenario-3: Proper library not installed as per your release version
It is possible that in your Linux box you are using both set of rpms i.e. 32-bit and 64-bit wherein the installed library package is 32-bit but your application package is looking for 64-bit library adn hence failing.
This I have already covered in Scenario-1 example on how to download and install packages for both 64-bit and 32-bit Linux environment.
Summary
We have explained the installation steps above. To remove packages, please pay attention to the following steps;
- After the removal of i386 architecture packages, your applications with 32-bit library dependencies will be affected. Take this into consideration.
- On a 64-bit architecture system, 32-bit libraries can cause confusion later, it is not recommended to install them. You should choose the 64-bit architecture compatible version of the application you want to use.
- It is not recommended to uninstall these packages on a 64-architecture system. If you try to uninstall, you will encounter the following warning;
You are about to do something potentially harmful. To continue type in the phrase 'Yes, do as I say!' ?]
Think twice before removing it.
Didn’t find what you were looking for? Perform a quick search across GoLinuxCloud
If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.
For any other feedbacks or questions you can either use the comments section or contact me form.
Thank You for your support!!
Cannot find /lib/libc.so.6
The libc.so.6 that it should be using is the one that sits at /home/work/worldcom/filesys/lib/libc.so.6 . What have I got wrong here?
linking libobj.so arm-none-linux-gnueabi-g++ obj1.o obj2.o obj2.o -o libobj.so -L/home/work/worldcom/filesys/usr -Wl,-O1 -Wl,-z,defs -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed -Wl,--hash-style=both -L/home/work/worldcom/filesys -L/home/work/worldcom/filesys/lib -L/home/work/worldcom/filesys/usr/lib -lcurl -shared /home/lishevita/armv5tel/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6 /home/lishevita/armv5tel/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/libc.so.6 collect2: ld returned 1 exit status
make: *** [libobj.so] Error 1
My makefile is handwritten (i.e. not generated by Autotools). In order to avoid a blanket «your Makefile is broken» here are some details from the makefile that might help clarify.
CROSS_COMPILE = arm-none-linux-gnueabi- SYSROOT = /home/work/worldcom/filesys/ DESTDIR = /home/work/worldcom/filesys/ RELEASE_CXXFLAGS = -Os DEBUG_CXXFLAGS = -O0 -gstabs PKGCONFIG=`env ROOT=/home/work/worldcom/filesys cross-pkg-config glib-2.0 libcurl --cflags` CC = $(CROSS_COMPILE)gcc CXX = $(CROSS_COMPILE)g++ LD = $(CROSS_COMPILE)ld AR = $(CROSS_COMPILE)ar LDFLAGS = -Wl,-O1 -Wl,-z,defs -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed -Wl,--hash-style=both -L$(SYSROOT) -L$(SYSROOT)lib -L$(SYSROOT)usr -L$(SYSROOT)usr/lib -lcurl libobj.so: $(LIBOBJ_OBJS) @echo linking $@ $(CXX) $^ -o $@ $(LDFLAGS) -shared $(PKG_LIBS)
Of course there is also a definition and target for the LIBOBJ_OBJS but those are irrelevant to the problem.