centos怎么看glibc版本 Linux查看glibc版本方法
(1) 可通过rpm -qa | grep glibc查看系统目前安装了哪些和glibc有关的包:[root@Cluster ~]# rpm -qa | grep glibcglibc-2.12-1.47.el6_2.12.i686glibc-headers-2.12-1.47.el6_2.12.x86_64glibc-common-2.12-1.47.el6_2.12.x86_64glibc-devel-2.12-1.47.el6_2.12.x86_64glibc-2.12-1.47.el6_2.12.x86_64可以看到系统上glibc的版本号为2.12。如果想进一步查看,可通过rpm -qi glibc:[root@Cluster ~]# rpm -qi glibcName : glibc Relocations: (not relocatable)Version : 2.12 Vendor: CentOSRelease : 1.47.el6_2.12 Build Date: 2012年05月10日 星期四 16时11分39秒Install Date: 2012年05月21日 星期一 17时46分08秒 Build Host: c6b5.bsys.dev.centos.orgGroup : System Environment/Libraries Source RPM: glibc-2.12-1.47.el6_2.12.src.rpmSize : 12871227 License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+Signature : RSA/SHA1, 2012年05月10日 星期四 18时01分09秒, Key ID 0946fca2c105b9dePackager : CentOS BuildSystemURL : http://sources.redhat.com/glibc/Summary : The GNU libc librariesDescription :The glibc package contains standard libraries which are used bymultiple programs on the system. In order to save disk space andmemory, as well as to make upgrading easier, common system code iskept in one place and shared between programs. This particular packagecontains the most important sets of shared libraries: the standard Clibrary and the standard math library. Without these two libraries, aLinux system will not function.(2) 也可以通过查看ls -l /lib/libc.so.6输出结果:[root@Cluster ~]# ls -l /lib/libc.so.6lrwxrwxrwx. 1 root root 12 5月 21 17:46 /lib/libc.so.6 -> libc-2.12.so2 ubuntu(以ubuntu 11.04为例):(1) 查看 ls -l /lib/i386-linux-gnu/libc.so.6的输出:wzw@wzw-Lenovo:~$ ls -l /lib/i386-linux-gnu/libc.so.6lrwxrwxrwx 1 root root 12 2012-07-15 09:14 /lib/i386-linux-gnu/libc.so.6 -> libc-2.13.so(2) 也可以使用 apt-cache show libc6:wzw@wzw-Lenovo:~$ apt-cache show libc6Package: libc6Priority: requiredSection: libsInstalled-Size: 9456Maintainer: Ubuntu Core developersOriginal-Maintainer: GNU Libc MaintainersArchitecture: i386Source: eglibcVersion: 2.13-0ubuntu13Replaces: belocs-locales-bin, libc6-i386Provides: glibc-2.13-1, libc6-i686Depends: libc-bin (= 2.13-0ubuntu13), libgcc1, tzdataSuggests: glibc-doc, debconf | debconf-2.0, localesConflicts: belocs-locales-bin, libc6-i686, prelink (<< 0.0.20090925), tzdata (<< 2007k-1), tzdata-etchBreaks: nscd (<< 2.13)Filename: pool/main/e/eglibc/libc6_2.13-0ubuntu13_i386.debSize: 3764596MD5sum: 1cfb03baf7c299fcf266f1c9b20c00a5SHA1: 2f2d25e96ae7a8f9489a460154ffc31460b2deadSHA256: c3336e5b6480591925974be5329eaa56a5632697eeb4a75de52905b3efd65e81Description-zh_CN: Embedded GNU C Library: Shared libraries本软件包包含了系统中几乎所有程序都会用到的标准运行库,包括标准 C 语言共享库和标准数学 库,以及许多其它的运行库。Multi-Arch: sameOrigin: UbuntuSupported: 18mTask: minimal最后,给楼主推荐一本比较实用的linux工具书,看图:
glibc和libc到底有什么区别?
glibc和libc都是Linux下的C函数库,libc是Linux下的ANSI C的函数库;glibc是Linux下的GUN C的函数库。glibc是gnu发布的libc库,也即c运行库。glibc是linux系统中最底层的api(应用程序开发接口),几乎其它任何的运行库 都会倚赖于glibc。glibc除了封装linux操作系统所提供的系统服务外,它本身也提供了许多其它一些必要功能服务的实现,主要的如下:(1)string,字符串处理(2)signal,信号处理(3)dlfcn,管理共享库的动态加载(4)direct,文件目录操作(5)elf,共享库的动态加载器,也即interpreter(6)iconv,不同字符集的编码转换(7)inet,socket接口的实现(8)intl,国际化,也即gettext的实现(9)io(10)linuxthreads(11)locale,本地化(12)login,虚拟终端设备的管理,及系统的安全访问(13)malloc,动态内存的分配与管理(14)nis(15)stdlib,其它基本功能

