博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS yum 提示段错误 (core dumped)
阅读量:6589 次
发布时间:2019-06-24

本文共 2714 字,大约阅读时间需要 9 分钟。

  hot3.png

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root ~]# 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)

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

1
# vim /usr/bin/yum

查看第一行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python2.6
importsys
try:
    importyum
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
 
Pleaseinstalla packagewhichprovides 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,whichis:
%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:
    importyummain
    yummain.user_main(sys.argv[1:], exit_code=True)
except KeyboardInterrupt, e:
    print >> sys.stderr,"\n\nExiting on user cancel."
    sys.exit(1)

第一行是

1
#!/usr/bin/python2.6

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

1
2
[root ~]# /usr/bin/python2.6 -V
Python 2.6.6

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

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

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

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

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

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

然后再clean下

1
# yum clean all

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[root ~]# 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
---> Packagebash.x86_64 0:4.1.2-14.el6 will be updated
---> Packagebash.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

搞定,收工!

转载于:https://my.oschina.net/liting/blog/419866

你可能感兴趣的文章
手机版页面正式发布 html5取代wap(wml)
查看>>
centos7-修改主机名
查看>>
面试宝典系列-mysql面试基础题
查看>>
pymssql的简单使用
查看>>
微信硬件平台对接--蓝牙
查看>>
mysql 5.7.16安装与给远程连接权限
查看>>
GitHub上最流行的10000个Java都使用了哪些库?
查看>>
也来谈一谈js的浅复制和深复制
查看>>
spring data for mongo
查看>>
开启 URL 重写
查看>>
Journey源码分析二:整体启动流程
查看>>
Shell特殊变量:Shell $0, $#, $*, $@, $?, $$和命令行参数
查看>>
七、MySQL中的字符集 - 系统的撸一遍MySQL
查看>>
centos7的php5.4竟然不支持原生的mysql
查看>>
使用IntelliJ IDEA开发SpringMVC网站(四)用户管理
查看>>
Maven依赖Scope标签用法
查看>>
堆排序的原理
查看>>
ajax加载数据到页面无法打印的解决办法
查看>>
js 验证中文
查看>>
MySQL给查询结果添加一表表示行号或名次(1)
查看>>