如何解决centos yum 段错误问题

网友投稿 1204 2022-10-11

本站部分文章、图片属于网络上可搜索到的公开信息,均用于学习和交流用途,不能代表睿象云的观点、立场或意见。我们接受网民的监督,如发现任何违法内容或侵犯了您的权益,请第一时间联系小编邮箱jiasou666@gmail.com 处理。

如何解决centos yum 段错误问题

centos yum段错误的解决办法:1、执行“# rm -f /etc/yum.repos.d/soluslabs.repo”命令;2、重新yum update即可。

本文操作环境:CentOS 7系统、python2.6、Dell G3电脑。

如何解决centos yum 段错误问题?

CentOS yum 段错误 (core dumped)解决方法

今天在yum install 或者yum update的时候都提示段错误(core dumped),然后终止运行了。

代码如下:

[root@lee ~]# yum -y updateLoaded plugins: fastestmirror, refresh-packagekitDetermining fastest mirrors * base: mirror.esocc.com * extras: mirror.esocc.com * soluslabs: mirror.us1.soluslabs.net * updates: mirror.esocc.combase | 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)

到谷歌上找各种大虾的文章还是无济于事,只好认真查看错误!首先我确定了不是因为Python版本的原因,因为之前安装了一个Python2.7.4。

代码如下:

# vim /usr/bin/yum

查看第一行

代码如下:

#!/usr/bin/python2.6import systry: import yumexcept ImportError: print >> sys.stderr, """\There was a problem importing one of the Python modulesrequired to run yum. The error leading to this problem was: %sPlease install a package which provides this module, orverify that the module is installed correctly.It's possible that the above module doesn't match thecurrent version of Python, which is:%sIf 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)

第一行是

代码如下:

#!/usr/bin/python2.6

直接看这个Python2.6是不是有问题

代码如下:

[root@lee ~]# /usr/bin/python2.6 -VPython 2.6.6

正确识别版本号,没问题。在yum clean all 以后都无济于事的时候,我突然想到会不会/etc/yum.repos.d/目录下多了东西?

代码如下:

[root@lee ~]# ls /etc/yum.repos.d/CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo soluslabs.repo

发现里边有一个soluslabs.repo跟我yum命令报错的地方都是一个资源库,看来问题就在这了。

代码如下:

soluslabs | 951 B 00:00 soluslabs/primary | 11 kB 00:00 段错误 (core dumped)

段错误的上一行是soluslabs,于是我直接rm它

代码如下:

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

然后再clean下

代码如下:

# yum clean all

好滴,我们再回到熟悉的yum update

代码如下:

[root@lee ~]# yum -y updateLoaded plugins: fastestmirror, refresh-packagekitDetermining fastest mirrors * base: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.tuna.tsinghua.edu.cnbase | 3.7 kB 00:00 base/primary_db | 4.4 MB 00:20 extras | 3.4 kB 00:00 extras/primary_db 00:00 updates | 3.4 kB 00:00 updates/primary_db | 3.9 MB 00:13 Setting up Update ProcessResolving 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

搞定,收工!

另一个解决方法:

使用yum命令安装东西或者yum update时都提示以下错误:

代码如下:

[root@lee ~]# yum updateLoaded plugins: fastestmirror, refresh-packagekitLoading 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)

解决方法:

代码如下:

[root@lee ~]# rpm -q zlib zlib-develzlib-1.2.3-29.el6.x86_64zlib-devel-1.2.3-29.el6.x86_64[root@lee ~]# cp /usr/lib64/libDisplay all 1910 possibilities? (y or n)[root@lee ~]# cp /usr/lib64/libz.so /usr/local/lib64/[root@lee ~]# cd /usr/local/lib64/[root@lee lib64]# ln -sf libz.so libz.so.1[root@lee lib64]# yum clean all

我的系统是CentOS 64位,如果是32位的在赋值libz.so时这么复制

代码如下:

[root@lee ~] cp /usr/lib/libz.so /usr/local/lib/

然后重新yum update就可以了.

推荐教程:《centos教程》

php入门到就业线上直播课:查看学习

上一篇:centos vimrc在哪
下一篇:如何解决centos u盘乱码问题
相关文章

 发表评论

暂时没有评论,来抢沙发吧~