Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1202547
  • 博文数量: 261
  • 博客积分: 4196
  • 博客等级: 上校
  • 技术积分: 3410
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-17 17:05
文章分类

全部博文(261)

文章存档

2018年(1)

2017年(22)

2016年(2)

2015年(8)

2014年(27)

2013年(40)

2012年(161)

分类: LINUX

2012-11-14 10:17:30

原文:

由于其他软件需要更高级的glibc 所以升级如下:

首先用centos的yum升级glibc库

  • yum update glibc

但问题依旧。用命令查看glibc库的信息

  • rpm -qi glibc

显示系统的glibc库版本为2.5

在CentOS中用更新命令到2.5已经是最新版本了,只好手动下载 glibc 2.11的源码包编译安装更新:

地址:


  • cd /usr/src 

  • mkdir glibc-2.11-build 

  • wget  

  • tar zxvf glibc-2.11.tar.gz 

  • cd /usr/src/glibc-2.11-build/ 

  • export CFLAGS="-g -O2 -march=i686"

  • /usr/src/glibc-2.11/configure --prefix=/usr/src/glibc-2.11-build/ --with-headers=/usr/include

  • make 

  • make install

注意:

1.   在目录usr/src/glibc-2.11执行configure命令时不能执行,需在外部文件夹glibc-2.11-build 执行

2.   加上优化开关,export CFLAGS="-g -O2 -march=i686",否则会出现错误,此处的i686请参照自己的机器

3.    当有如下错误时:

checking whether ranlib is necessary... no
checking LD_LIBRARY_PATH variable... contains current directory
configure: error:
*** LD_LIBRARY_PATH shouldn't contain the current directory when
*** building glibc. Please change the environment variable
*** and run configure again.
解决办法:查看LD_LIBRARY_PATH  echo $LD_LIBRARY_PATH,我的打印的是/usr/lib/qt44/lib:

configure里说:LD_LIBRARY_PATH不能以终结符作为开始和最后一个字符,不能有2个终结符连在一起,所以修改下LD_LIBRARY_PATH即可,export LD_LIBRARY_PATH=/usr/lib/qt44/lib

4.   当有如下错误时:

configure: error: gcc must provide the  header

解决办法:get the cpuid.h file from official GCC respositories> ()> and put it into /usr/include(上面指定的--with-headers)

4.   当以上问题都解决时,make  make install吧,由于东西比较多,需要些时间,大概半小时左右
阅读(3629) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~