My Advanced Linux/RedHat Knowledge

yum commands are segfaulting

우주곰 2012. 4. 2. 15:45

Issue

When I try to run "yum update", the following error occurs:

# yum update
Loaded plugins: downloadonly, rhnplugin
rhel-i386-server | 1.4 kB 00:00
rhel-i386-server5/primary | 3.3 MB 00:01
Segmentation fault

Environment

Red Hat Enterprise Linux 5.5

Resolution

Move the /usr/local/lib/libz* files out of the way so it uses the Red Hat supplied libz* libraries:

mv /usr/local/lib/libz* /tmp

Root Cause

yum is using /usr/local/lib/libz.so.1 instead of the system libraries in /usr/lib and /lib.

Diagnostic Steps

1. Tried cleaning the yum cache:

# yum clean all
# yum clean metadata
# rm -rf /var/cache/yum/*
# rhn-profile-sync
# yum check-update

... but yum still segfaults

2. Customer is using 3rd party libraries:

$ cat etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib/
/usr/local/jpeg/lib/
/usr/local/freetype/lib/
/usr/local/gd/lib/
/usr/local/mysql/lib/
/export/sources/php-5.2.13/libs

3. Got an strace of yum:

# strace -ffvto trace_yumupdate.txt yum update
...$ cat  trace_yumupdate.txt.6566 | grep 'open.*/usr/local/lib' | grep -v ENOENT
15:21:40 open("/usr/local/lib/libz.so.1", O_RDONLY) = 6

... so yum is using the libz.so.1 library from /usr/local/lib instead of from /usr/lib or /lib