CentOS6.X默认的glibc版本最高为2.12,但实际应用中,许多项目所依赖的包往往需要更高版本的glibc库支持。
方法一
适用于CentOS 6 x64:
准备工作
1、升级系统
1 |
yum update–y |
2、安装kernel-headers
1 |
yum install kernel–headers–y |
3、安装gcc
1 |
yum–yinstall gcc gcc–c++ |
4、更新glibc list
1 2 |
yum update glibc yum list glibc |
升级glibc 版本,把下面的代码复制到linux中运行
1 2 3 4 5 6 7 8 9 10 11 12 |
wget–cftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/f/fu/fuduntu-el/el6/current/UNSTABLE/RPMS/glibc-utils-2.15-60.el6.x86_64.rpm wget–cftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/f/fu/fuduntu-el/el6/current/UNSTABLE/RPMS/glibc-headers-2.15-60.el6.x86_64.rpm wget–cftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/f/fu/fuduntu-el/el6/current/UNSTABLE/RPMS/glibc-static-2.15-60.el6.x86_64.rpm wget–cftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/f/fu/fuduntu-el/el6/current/UNSTABLE/RPMS/glibc-common-2.15-60.el6.x86_64.rpm wget–cftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/f/fu/fuduntu-el/el6/current/UNSTABLE/RPMS/glibc-2.15-60.el6.x86_64.rpm wget–cftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/f/fu/fuduntu-el/el6/current/UNSTABLE/RPMS/glibc-2.15-60.el6.i686.rpm wget–cftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/f/fu/fuduntu-el/el6/current/UNSTABLE/RPMS/glibc-devel-2.15-60.el6.x86_64.rpm wget–cftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/f/fu/fuduntu-el/el6/current/UNSTABLE/RPMS/nscd-2.15-60.el6.x86_64.rpm sudo rpm–e—nodeps—justdb glibc–2.*.i686—allmatches rpm–Uvh*–2.15–60.el6.x86_64.rpm rpm–Uvh glibc–2.15–60.el6.i686.rpm ldconfig |
首先是一些关键包,nscd可以不要,但为了防止个别使用了nscd的,所以顺便更新了。
这个时候,便已将glibc更新到2.15版本。
64位下,经常同时安装了x86_64和i686版本的glibc,升级需要先卸载i686版本,然后执行更新,再重新安装i686版本(部分程序在编译需要32位的库)。
查看系统glibc版本可使用如下命令:
1 |
ls–l/lib64/libc.so.6 |
详细glibc支持可以用以下命令查看:
1 |
strings/lib64/libc.so.6|grepGLIBC_ |
方法二
准备工作如方法一,不再重复。
1 2 3 4 5 6 7 |
mkdirglibc cdglibc wget–chttp://ftp.redsleeve.org/pub/steam/glibc–2.15–60.el6.x86_64.rpm wget–chttp://ftp.redsleeve.org/pub/steam/glibc–common–2.15–60.el6.x86_64.rpm wget–chttp://ftp.redsleeve.org/pub/steam/glibc–devel–2.15–60.el6.x86_64.rpm wget–chttp://ftp.redsleeve.org/pub/steam/glibc–headers–2.15–60.el6.x86_64.rpm wget–chttp://ftp.redsleeve.org/pub/steam/nscd–2.15–60.el6.x86_64.rpm |
rpm包下载完成后执行以下命令
1 2 3 4 5 |
rpm–Uvh glibc–2.15–60.el6.x86_64.rpm glibc–common–2.15–60.el6.x86_64.rpm glibc–devel–2.15–60.el6.x86_64.rpm glibc–headers–2.15–60.el6.x86_64.rpm nscd–2.15–60.el6.x86_64.rpm |
https://www.234du.com/post-1022.html
本文部分代码参考自:kn007博客
Leave a reply