Use ldd --version:

Copy$ ldd --version
ldd (GNU libc) 2.17
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
...

You can also run libc itself:

Copy$ /lib/libc.so.6
GNU C Library (GNU libc) stable release version 2.17, by Roland McGrath et al.
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
...
Answer from John on Stack Overflow
🌐
Linux Questions
linuxquestions.org › questions › linux-software-2 › how-to-check-glibc-version-263103
how to check glibc version? - Linux
December 6, 2004 - hi, any method to check glibc version using in my linux box? anyone have idea on this? thanks, jim
Discussions

compiling - Check the actual glibc version used - Unix & Linux Stack Exchange
I want check the glibc version used by toolchain to build code for the target system (ARM). In toolchain directory I tried strings /sysroot/lib/libc.so.6 | grep GLIBC the output is GLIBC_2.4 GL... More on unix.stackexchange.com
🌐 unix.stackexchange.com
August 23, 2019
How to check glibc version?

ldd --version

More on reddit.com
🌐 r/MXLinux
4
3
September 27, 2022
linux - How can you determine installed versions of the glibc libraries? - Stack Overflow
I'm working with an embedded Linux deployment and am using a cross compiler tool chain that doesn't compile I2C library function calls. How do I determine the precise versions of the libraries on ... More on stackoverflow.com
🌐 stackoverflow.com
What C library version does my system use? - Unix & Linux Stack Exchange
GNU/Linux systems usually use either ... glibc (see EGLIBC 2.19 Branch Created under "News"), in the near future they will all be glibc again. The easiest way to check the exact version is to ask ldd, which ships with the C library.... More on unix.stackexchange.com
🌐 unix.stackexchange.com
March 19, 2014
🌐
Lindevs
lindevs.com › check-glibc-version-in-linux
Check glibc Version in Linux | Lindevs
June 29, 2022 - The ldd command can be used to check version of the glibc.
🌐
DEV Community
dev.to › bitecode › how-to-get-glibc-version-c-lang-26he
How to get glibc version - C Lang - DEV Community
April 27, 2020 - We can also use the libc.so to print out version. First we need to find out the path of libc.so. You can use ldd to a binary to find out the libc.so: $ ldd `which ls` | grep libc libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f918034d000) ...
🌐
OpenGenus
iq.opengenus.org › find-glibc-version
Find glibc version in your system
In this guide at OpenGenus, we present 3 different ways to identify compile time and run time version of glibc. The version of glibc has two components: Major version and Minor version.
🌐
LinuxConfig
linuxconfig.org › home › check libc version
Check and Update libc Version on Linux
September 22, 2025 - The process for checking your installed version of libc will be the same regardless of your Linux distro. Simply use the ldd command as seen below. $ ldd --version ldd (Ubuntu GLIBC 2.35-0ubuntu3) 2.35 ...
🌐
Xmodulo
xmodulo.com › check-glibc-version-linux.html
How to check glibc version on Linux
July 9, 2020 - A simple command-line to check the version of the GNU C library is as follows. ... In this example, the version of glibc is 2.19.
Find elsewhere
🌐
Cylab
cylab.be › blog › 388 › a-solution-to-version-glibc-2xx-not-found
A Solution to Version GLIBC_2.XX Not Found | cylab.be
January 15, 2025 - In this case, the binary my-binary needs glibc version 2.XX, but your system either has another version or none at all. You can check whether the program is linked dynamically or statically using the ldd command.
🌐
Liquid Web
liquidweb.com › home › how to check the glibc version on centos
How to Check the glibc Version on CentOS | Liquid Web
August 26, 2024 - In this case, version 2.17 is installed. ... Loaded plugins: fastestmirror, langpacks, priorities Loading mirror speeds from cached hostfile 3 packages excluded due to repository priority protections Installed Packages glibc.x86_64 2.17-55.el7_0.3 @system-updates-released Available Packages glibc.i686 2.17-55.el7_0.3 system-updates-released
🌐
Lindevs
lindevs.com › check-glibc-version-required-by-binary-file-on-linux
Check glibc Version Required by Binary File On Linux | Lindevs
March 27, 2025 - objdump -T /usr/bin/mkdir | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu ... This output means that the system needs at least the highest version listed (2.34 in this case) to run it without compatibility issues.
🌐
LinuxVox
linuxvox.com › blog › linux-get-glibc-version
Linux: How to Get the GLIBC Version — linuxvox.com
The ldd (list dynamic dependencies) command is a widely used tool to list the shared libraries that a program depends on. You can use it to get the GLIBC version by checking the version of the libc.so library.
🌐
Oreate AI
oreateai.com › blog › how-to-check-your-glibc-version-on-linux-a-comprehensive-guide › 0f45dcbd467415d4f321107d9b4a503e
How to Check Your Glibc Version on Linux: A Comprehensive Guide - Oreate AI Blog
January 21, 2026 - dpkg -s libc6 | grep Version \\ OR \\ strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ in Ubuntu-based distributions or similar commands depending on your distribution package manager. This approach gives you a direct insight into what’s currently installed without relying on additional tools. For those who enjoy programming or need more control over their checks, writing a small program in C can also yield results about the current glibc version installed on your machine.
🌐
GitHub
gist.github.com › likema › f5c04dad837d2f5068ae7a8860c180e7
CMake macro to detect glibc version by filename. · GitHub
Well, one thing which often works - not sure whether it always works - is run libc.so.6. Yes, it's typically executable - and prints version information. ... It seems STRING (REPLACE "libc-" "" GLIBC_VERSION ${GLIBC_VERSION}) causes the problem. I resolved this by removing the dash character like STRING (REPLACE "libc" "" GLIBC_VERSION ${GLIBC_VERSION}).
🌐
codestudy
codestudy.net › blog › check-glibc-version-for-a-particular-gcc-compiler
How to Check Glibc Version for a Specific GCC Compiler (Non-Default Installation) — codestudy.net
For glibc, we target libc.so.6 (the shared library). Identify your non-default GCC path: Ensure you’re using the correct GCC. For example, if it’s installed in /opt/gcc-13/bin, use the full path or add it to PATH: # Check GCC version to confirm /opt/gcc-13/bin/gcc --version # Output should show "gcc (GCC) 13.2.0" or similar
🌐
LinuxVox
linuxvox.com › blog › linux-check-glibc-version
Checking the Glibc Version in Linux: A Comprehensive Guide — linuxvox.com
It can also assist in troubleshooting issues related to software crashes or errors that might be due to an outdated or incompatible glibc version. In this blog post, we will explore various methods to check the glibc version in Linux, including fundamental concepts, usage methods, common practices, ...
Top answer
1 of 6
62

GNU/Linux systems usually use either glibc (Fedora/Redhat family, Arch) or its close cousin, eglibc (Debian/Ubuntu family); since eglibc is now being merged back into glibc (see EGLIBC 2.19 Branch Created under "News"), in the near future they will all be glibc again.

The easiest way to check the exact version is to ask ldd, which ships with the C library.

On Fedora 20:

> ldd --version
ldd (GNU libc) 2.18

That's glibc 2.18.

On Raspbian (Debian 7 port for ARMv6 Broadcom SoC):

> ldd --version
ldd (Debian EGLIBC 2.13-38+rpi2) 2.13

That's eglibc 2.13.

If for whatever reason you have mixed and matched some parts or otherwise aren't sure about ldd, you can query the C library directly.

> whereis libc.so
libc: /usr/lib64/libc.a /usr/lib64/libc.so /usr/share/man/man7/libc.7.gz

None of those is executable but they provide a clue about where to find one.

> $(find /usr/lib64/ -executable -name "*libc.so*") --version
GNU C Library (GNU libc) stable release version 2.18, by Roland McGrath et al.

However, it is not necessarily so easy, because the C library does not have to reside somewhere whereis can find it.

> whereis libc.so
libc: /usr/share/man/man7/libc.7.gz

Unfortunately, the man page does not provide a version number. ldd still comes in handy, since any working, dynamically linked executable on the system (e.g., almost everything in /usr/bin) will link to the C library.

> ldd /usr/bin/touch
    /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6eed000)
    librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6ed0000)
    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6da1000)
    /lib/ld-linux-armhf.so.3 (0xb6efb000)
    libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6d82000)

libc.so.6 is on the third line.

> /lib/arm-linux-gnueabihf/libc.so.6 --version
GNU C Library (Debian EGLIBC 2.13-38+rpi2) stable release version 2.13, by Roland McGrath et al.
2 of 6
16

A system isn't actually limited to one C library. Most, though, primarily use only one, which will also be the one the default compiler uses. And since you're downloading source code to compile, that's the one you're concerned with.

Start with a trivial program:

#include <stdio.h>
int main() {
    printf("Hello, world\n");
    return 0;
}

compile it using the compiler you're going to use for the source code, then use ldd to find out where the C library is:

$ ldd ./libc-test 
        linux-vdso.so.1 (0x00007fff2e5fe000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8c8ad98000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f8c8b171000)

You now have the path to the C library. You could look this up in your package manager to find the package (e.g., dpkg -S /lib/x86_64-linux-gnu/libc.so.6 or rpm -q -f /lib/x86_64-linux-gnu/libc.so.6).

At least in the case of eglibc/glibc, you can run it:

$ /lib/x86_64-linux-gnu/libc.so.6  
GNU C Library (Debian EGLIBC 2.18-4) stable release version 2.18, by Roland McGrath et al.
Copyright (C) 2013 Free Software Foundation, Inc.
⋮

Finally, you could see if you can get clues from objdump -p /lib/x86_64-linux-gnu/libc.so.6, by looking in the version definitions section:

Version definitions:
1 0x01 0x0865f4e6 libc.so.6
2 0x00 0x09691a75 GLIBC_2.2.5
3 0x00 0x09691a76 GLIBC_2.2.6
⋮
21 0x00 0x06969197 GLIBC_2.17
        GLIBC_2.16 
22 0x00 0x06969198 GLIBC_2.18
        GLIBC_2.17 
23 0x00 0x0963cf85 GLIBC_PRIVATE
        GLIBC_2.18 

Note how the GLIBC_2.18 symbol has the most recent version number among the symbols listed, and the library version is indeed 2.18. It's eglibc, though (it aims to be binary-compatible with glibc 2.18, so it uses the same symbol versions).

You could also attempt to use strings to find out something about it. You'll want to specify a longer minimal length (-n), or use grep to search for something:

$ strings  /lib/x86_64-linux-gnu/libc.so.6 | grep 'version [0-9]'
$ strings  /lib/x86_64-linux-gnu/libc.so.6 | grep -iC1 'copyright'

both work for this eglibc.

NOTE: The Debian package utility dpkg-shlibdeps uses objdump under the hood, along with stored symbol information in Debian library packages to determine the minimum versions of dependencies required by binary Debian packages at build time. Basically, it looks at the symbols exported by the binary Debian package, and then finds the minimum versions of the libraries that contain those symbols.