centos yum Segmentation fault
 

        最近公司要开发新的产品,在本地搭建了一下服务端的开发环境,安装centos5.5,安装了一些编译php需要的库文件gd,libxml,zlib等等,n多操作后,再使用yum时发现如下错误:

[root@home ~]# yum update
Setting up Update Process
Setting up repositories
Segmentation fault

(段错误)

 

[root@home ~]# strace yum update

last lines of strace :

_llseek(6, 0, [0], SEEK_CUR) = 0
read(6, "<?xml version=\"1.0\" ?><repomd xm"..., 8192) = 3846
read(6, "", 4346) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

 

google大神和百度大神了n次,基本都是一样的解决方案(1、yum clean all 2、修改源 3、修改yum.conf),照此执行,但并不能解决我的问题,有点绝望,但上天不负有心人,找到了这个 http://bugs.centos.org/view.php?id=4702&nbn=1

给了我们(我和我的同事)一些启发,原来是我们安装的zlib1.2.5时指定了安装目录(./configure -prefix=/usr)对yum产生了影响,所以总结如下:

1、安装完系统后,运行一次#yum update(yum产生了缓存) ,然后再安装zlib1.2.5,之后如果不执行#yum clean all,则一直可以使用yum,不会报段错误

2、如果在执行yum前已经安装了zlib1.2.5,则需要做如下处理

#cd /usr/lib

#ln -sf libz.so.1.2.3 libz.so

#ln -sf libz.so.1.2.3 libz.so.1

 

但此后zlib就使用了旧版本,在成功执行了yum后,还需要将软连接更改

#cd /usr/lib

#ln -sf libz.so.1.2.5 libz.so

#ln -sf libz.so.1.2.5 libz.so.1

至此,问题解决了!

 

http://bugs.centos.org/view.php?id=4702&nbn=1 原文

0004702: yum fails with segfault after source zlib upgrade

Some apps require the latest version of zlib (1.2.5)
After installation from source yum segfaults. (took me ages to figure it out)
Solution, rm -rf /usr/lib/libz.* & reinstall zlib-1.2.3.

Affects all CentOS 4.* and RHEL 4.* versions.

[root@SirVic ~]# yum update
Setting up Update Process
Setting up repositories
Segmentation fault

last lines of strace :

_llseek(6, 0, [0], SEEK_CUR) = 0
read(6, "<?xml version=\"1.0\" ?><repomd xm"..., 8192) = 3846
read(6, "", 4346) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++