博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
centos 7 升级后yum install出现Exiting on user cancel
阅读量:7223 次
发布时间:2019-06-29

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

centos 7 升级后yum install出现Exiting on user cancel

centos 7.x升级后用yum install进行安装时经常出现Exiting on user cancel,例如:

[root@localhost ~]# yum install logstashLoaded plugins: axelget, fastestmirrorNo metadata available for baseNo metadata available for docker-main-repoNo metadata available for epelNo metadata available for extrasNo metadata available for logstash-1.5No metadata available for updatesLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: mirrors.ustc.edu.cn * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comResolving Dependencies--> Running transaction check---> Package logstash.noarch 1:1.5.6-1 will be installed--> Finished Dependency ResolutionDependencies Resolved========================================================================================================================================================================================================= Package                                        Arch                                         Version                                            Repository                                          Size=========================================================================================================================================================================================================Installing: logstash                                       noarch                                       1:1.5.6-1                                          logstash-1.5                                        86 MTransaction Summary=========================================================================================================================================================================================================Install  1 PackageTotal download size: 86 MInstalled size: 133 MIs this ok [y/d/N]: yDownloading packages:Delta RPMs disabled because /usr/bin/applydeltarpm not installed.logstash-1.5.6-1.noarch.rpm                                                                                                                                                       |    0 B  00:00:30 ... logstash-1.5.6-1.noarch.rpm                                                            2% [==                                                                          ] 141 kB/s | 2.5 MB  00:10:09 ETA Exiting on user cancel

总是出现Exiting on user cancel,导致不能正常安装。

这是yum的一个bug导致的问题。修改/usr/lib/python2.7/site-packages/urlgrabber/grabber.py.

vi /usr/lib/python2.7/site-packages/urlgrabber/grabber.py

将第1510行和1517行注释掉即可

修改前:

1510             elif errcode == 42:1511                 # this is probably wrong but ultimately this is what happens1512                 # we have a legit http code and a pycurl 'writer failed' code1513                 # which almost always means something aborted it from outside1514                 # since we cannot know what it is -I'm banking on it being1515                 # a ctrl-c. XXXX - if there's a way of going back two raises to1516                 # figure out what aborted the pycurl process FIXME1517                 raise KeyboardInterrupt

修改后:

1510             #elif errcode == 42:1511                 # this is probably wrong but ultimately this is what happens1512                 # we have a legit http code and a pycurl 'writer failed' code1513                 # which almost always means something aborted it from outside1514                 # since we cannot know what it is -I'm banking on it being1515                 # a ctrl-c. XXXX - if there's a way of going back two raises to1516                 # figure out what aborted the pycurl process FIXME1517             #    raise KeyboardInterrupt

然后以root用户运行如下命令升级:

yum clean metadatayum clean allyum upgrade

升级完成后运行yum命令安装即可。

  • 参考文档:http://www.ostechnix.com/yum-dont-work-in-clean-centos-7-how-to-fix-it/

转载地址:http://myeym.baihongyu.com/

你可能感兴趣的文章
最新邮箱匹配正则(邮箱前缀可包含"_")
查看>>
Python and Collective Intelligence KeyError: href
查看>>
初学图论-DAG单源最短路径算法
查看>>
LVS/HAProxy/Nginx的特点和对比
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
简单RPC框架-基于Consul的服务注册与发现
查看>>
[翻译] effective go 之 Embedding
查看>>
Test
查看>>
我的友情链接
查看>>
Spring 框架是什么?
查看>>
Open***在linux上的完美实现
查看>>
利用haproxy+keepalived来实现基于http 七层负载均衡功能
查看>>
自动化部署必备技能之搭建YUM仓库
查看>>
20岁出头的时候,请摆正位置,一无所有却拥有一切
查看>>
eclipse中加入写好的android工程和出现的错误
查看>>
大脑如何休息
查看>>
rhel6atime,mtime,ctime
查看>>
设置RHEL6的SSH连接时间
查看>>
加快OSPF快速收敛的方法
查看>>