리눅스2024. 9. 25. 10:29

리눅스에서 glibc(GNU C Library) 버전을 확인하는 방법이다. 프로그램을 설치할 때 간혹 특정 버전 이상의 glibc를 필요로하는 경우가 있는데, 현재 사용중인 리눅스의 glibc 버전을 확인할 수 있다. 

find와 grep을 이용해서 /lib 디렉토리 하위에서 libc.so.6 파일을 찾아본다. 터미널창에서 아래와 같이 입력.

find /lib/ -type f | grep "libc.so.6"

64비트 배포판이라면 통상 아래의 같이 나올 것이다. 

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

해당 파일을 실행시켜 본다. 위의 결과를 그대로 명령어로 입력하면 되겠다. 

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

그러면 아래와 같은 식으로 버전 정보를 확인할 수 있다. 이 경우는 glibc 버전이 2.36이다. 

GNU C Library (Debian GLIBC 2.36-9+deb12u4) stable release version 2.36.
Copyright (C) 2022 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.
Compiled by GNU CC version 12.2.0.
libc ABIs: UNIQUE IFUNC ABSOLUTE
Minimum supported kernel: 3.2.0
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.

 

Posted by 반달가면