CentOS Yum segment error (core dumped) solution

Time:2021-6-24

Today, when you use Yum install or Yum update, you will be prompted with a section error (core damped), and then you will stop running.

Copy code

The code is as follows:

[[email protected] ~]# yum -y update
Loaded plugins: fastestmirror, refresh-packagekit
Determining fastest mirrors
* base: mirror.esocc.com
* extras: mirror.esocc.com
* soluslabs: mirror.us1.soluslabs.net
* updates: mirror.esocc.com
base | 3.7 kB 00:00
base/primary_db | 4.4 MB 00:14
extras | 3.4 kB 00:00
extras/primary_db | 18 kB 00:00
soluslabs | 951 B 00:00
soluslabs/primary | 11 kB 00:00
Core dumped

To Google to find a variety of prawns article or useless, had to seriously look at the error! First of all, I made sure it wasn’t because of the python version, because a python 2.7.4 was installed.

Copy code

The code is as follows:

# vim /usr/bin/yum

Look at the first line

Copy code

The code is as follows:

#!/usr/bin/python2.6
import sys
try:
import yum
except ImportError:
print >> sys.stderr, “””\
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

%s

Please install a package which provides this module, or
verify that the module is installed correctly.

It’s possible that the above module doesn’t match the
current version of Python, which is:
%s

If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq

“”” % (sys.exc_value, sys.version)
sys.exit(1)

sys.path.insert(0, ‘/usr/share/yum-cli’)
try:
import yummain
yummain.user_main(sys.argv[1:], exit_code=True)
except KeyboardInterrupt, e:
print >> sys.stderr, “\n\nExiting on user cancel.”
sys.exit(1)

The first line is

Copy code

The code is as follows:

#!/usr/bin/python2.6

Let’s see if there is a problem with Python 2.6

Copy code

The code is as follows:

[[email protected] ~]# /usr/bin/python2.6 -V
Python 2.6.6

Identify the version number correctly, no problem. When Yum clean all doesn’t help, I suddenly wonder if there are more things in / etc / yum.repos.d/directory?

Copy code

The code is as follows:

[[email protected] ~]# ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo soluslabs.repo

It is found that there is a resource library in which soluslabs.repo and my Yum command report errors. It seems that this is the problem.

Copy code

The code is as follows:

soluslabs | 951 B 00:00
soluslabs/primary | 11 kB 00:00
Core dumped

The last line in the error section is solulabs, so I’ll just call it

Copy code

The code is as follows:

# rm -f /etc/yum.repos.d/soluslabs.repo

Then clean it

Copy code

The code is as follows:

# yum clean all

OK, let’s go back to the familiar Yum update

Copy code

The code is as follows:

[[email protected] ~]# yum -y update
Loaded plugins: fastestmirror, refresh-packagekit
Determining fastest mirrors
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
base | 3.7 kB 00:00
base/primary_db | 4.4 MB 00:20
extras | 3.4 kB 00:00
extras/primary_db | 18 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 3.9 MB 00:13
Setting up Update Process
Resolving Dependencies
–> Running transaction check
—> Package bash.x86_64 0:4.1.2-14.el6 will be updated
—> Package bash.x86_64 0:4.1.2-15.el6_4 will be an update
—> Package bind-libs.x86_64 32:9.8.2-0.17.rc1.el6_4.4 will be updated

Done, done!

Another solution:

The following error will be prompted when using the yum command to install things or Yum update:

Copy code

The code is as follows:

[[email protected] ~]# yum update
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* soluslabs: mirror.eu1.soluslabs.net
* updates: mirrors.tuna.tsinghua.edu.cn
Core dumped

resolvent:

Copy code

The code is as follows:

[[email protected] ~]# rpm -q zlib zlib-devel
zlib-1.2.3-29.el6.x86_64
zlib-devel-1.2.3-29.el6.x86_64
[[email protected] ~]# cp /usr/lib64/lib
Display all 1910 possibilities? (y or n)
[[email protected] ~]# cp /usr/lib64/libz.so /usr/local/lib64/
[[email protected] ~]# cd /usr/local/lib64/
[[email protected] lib64]# ln -sf libz.so libz.so.1
[[email protected] lib64]# yum clean all

My system is 64 bit CentOS. If it’s 32-bit, I copy it when I assign libz.so

Copy code

The code is as follows:

[[email protected] ~] cp /usr/lib/libz.so /usr/local/lib/

Then update again