zl程序教程

您现在的位置是:首页 >  系统

当前栏目

Linux查看系统glibc版本号

Linux系统 查看 版本号 glibc
2023-09-14 09:09:56 时间
1.第一种
# ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1) 2.27
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

2.第二种
# ls -alh /lib/x86_64-linux-gnu/libc.so.6 
lrwxrwxrwx 1 root root 12 Apr 17  2018 /lib/x86_64-linux-gnu/libc.so.6 -> libc-2.27.so
注意:libc-2.27.so :版本号即2.27

# strings /lib/x86_64-linux-gnu/libc-2.27.so |grep -in5 version

GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1) stable release version 2.27.
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

3.第三种
//glibc_version.c
#include <stdio.h>
#include <gnu/libc-version.h>
int main(void)
{
  printf("glic_version = %s\n",gnu_get_libc_version());
  return 0;
}
# gcc glibc_version.c
# ./a.out
glic_version = 2.27