centos 7 升级后yum install出现Exiting on user cancel
centos 7 升级后yum install出现Exiting on user cancel
centos 7.x升级后用yum install进行安装时经常出现Exiting on user cancel
,例如:
[root@localhost ~]# yum install logstash
Loaded plugins: axelget, fastestmirror
No metadata available for base
No metadata available for docker-main-repo
No metadata available for epel
No metadata available for extras
No metadata available for logstash-1.5
No metadata available for updates
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package logstash.noarch 1:1.5.6-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================================================
Installing:
logstash noarch 1:1.5.6-1 logstash-1.5 86 M
Transaction Summary
=========================================================================================================================================================================================================
Install 1 Package
Total download size: 86 M
Installed size: 133 M
Is this ok [y/d/N]: y
Downloading 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 happens
1512 # we have a legit http code and a pycurl 'writer failed' code
1513 # which almost always means something aborted it from outside
1514 # since we cannot know what it is -I'm banking on it being
1515 # a ctrl-c. XXXX - if there's a way of going back two raises to
1516 # figure out what aborted the pycurl process FIXME
1517 raise KeyboardInterrupt
修改后:
1510 #elif errcode == 42:
1511 # this is probably wrong but ultimately this is what happens
1512 # we have a legit http code and a pycurl 'writer failed' code
1513 # which almost always means something aborted it from outside
1514 # since we cannot know what it is -I'm banking on it being
1515 # a ctrl-c. XXXX - if there's a way of going back two raises to
1516 # figure out what aborted the pycurl process FIXME
1517 # raise KeyboardInterrupt
然后以root用户运行如下命令升级:
yum clean metadata
yum clean all
yum upgrade
升级完成后运行yum命令安装即可。
- 参考文档:
http://www.ostechnix.com/yum-dont-work-in-clean-centos-7-how-to-fix-it/
扫描公众号,关注更多信息
---------------------------------------------------------------------------------我是分割线--------------------------------------------------------------------------to be a better me, talk is cheap show me the code
版权所有,转载请注明原文链接。
文中有不妥或者错误的地方还望指出,以免误人子弟。如果觉得本文对你有所帮助不妨【推荐】一下!如果你有更好的建议,可以给我留言讨论,共同进步!
再次感谢您耐心的读完本篇文章。
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
2015-08-09 linux自定义脚本添加到rc.local脚本无法正常运行的问题