yum Segmentation fault 错误解决

root@MINTQWEB1:/var/run>yum install gcc*
Configuration file /etc/yum/pluginconf.d/security.conf not found
Unable to find configuration file for plugin security
Loaded plugins: fastestmirror
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Repository pgdg10 is listed more than once in the configuration
Repository pgdg10-source is listed more than once in the configuration
Repository pgdg10-updates-testing is listed more than once in the configuration
Repository pgdg10-source-updates-testing is listed more than once in the configuration
Determining fastest mirrors
 * base: ftp.sjtu.edu.cn
 * epel: mirrors.aliyuncs.com
 * extras: mirrors.cn99.com
 * updates: mirrors.cn99.com
Elasticsearch                                                                                                                          | 1.3 kB     00:00     
Elasticsearch/primary                                                                                                                  |  67 kB     00:00     
Segmentation fault

        百度和google了一下,都说是centos下yum依赖于libz的问题,因为我安装zlib1.2.5的时候指定了安装目录/usr/local/zlib-1.2.5,对yum产生了影响,
具体原因如下:

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

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

#cd /usr/local/zlib-1.2.5  (这个是我的安装目录)

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

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


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

#cd /usr/local/zlib-1.2.5  (这个是我的安装目录)

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

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

至此,问题解决了!


扫描二维码关注公众号,回复: 1504901 查看本文章

        下面说说排查的过程。

    

        开始单方面以为是yum损坏, 需要修复,于是就重装了yum,发现问题还没能解决。看到网上都说是系统装了两个版本的libz引起的(系统默认的是1.2.3),

于是用命令查看:


[root@hhh ~]# ldconfig -v|grep libz

libz.so.1 -> libz.so.1.2.5

libz.so.1 -> libz.so.1.2.3

libz.so.1 -> libz.so.1.2.3


[root@hhh ~]# find / -name 'libz.so.1'

/data/check_data/zlib-1.2.5/libz.so.1

/usr/lib64/libz.so.1

/usr/lib/libz.so.1

/usr/local/zlib-1.2.5/lib/libz.so.1


于是切换到/usr/local/zlib-1.2.5/lib/目录,使用ll查看:

        
      于是就libz.so.1  先删除掉,重现软链到/usr/lib64/libz.so.1.2.3,但这里有个奇怪问题,就重新软链后发现,过一两分钟又自动恢复到原来的软件了,我也还没弄清楚问题所在,
干脆就把libz.so.1.2.5备份起来,再用/usr/lib64/libz.so.1.2.3来软链替换掉,这样就解决了。
 


猜你喜欢

转载自blog.csdn.net/eagle89/article/details/80535952