Check glibc Version in Linux

Check glibc Version in Linux

The GNU C Library also known as glibc, is an open-source implementation of the C standard library. Finding out which version of the glibc is installed in the system can be useful when compiling binaries.

This tutorial explains how to check glibc version in Linux.

1. ldd command

The ldd command can be used to check version of the glibc. In most cases the following command prints the same version as glibc:

ldd --version

Output example:

ldd (Ubuntu GLIBC 2.31-0ubuntu9.7) 2.31

2. libc.so binary

The glibc version can be checked by running its binary. First, find out the path of libc.so as follows:

ldd `which cat` | grep libc

Output example:

libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3e59b17000)

Now simply run libc.so binary:

/lib/x86_64-linux-gnu/libc.so.6

Output example:

GNU C Library (Ubuntu GLIBC 2.31-0ubuntu9.7) stable release version 2.31.

Leave a Comment

Cancel reply

Your email address will not be published.