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.cnblogs.com/rwxwsblog/p/5753802.html,如需转载请自行联系原作者

目录
相关文章
|
1月前
|
缓存 Linux
CentOS-6的iso下载地址镜像yum源
通过上述步骤,您可以成功下载CentOS 6的ISO镜像文件,并配置适用于CentOS 6的YUM源。尽管CentOS 6已经停止更新,但使用这些镜像和YUM源配置,可以继续在需要的环境中使用和维护CentOS 6系统。
278 20
|
1月前
|
Linux
CentOs9 yum源出现404问题
CentOs9-stream yum源出现404问题
|
2月前
|
缓存 Linux
解决CentOS 7停止更新后yum源失效问题【图文教程】
以上步骤完成后,你的 CentOS 7 系统就会使用阿里云的 yum 源,更换yum以后就可以正常使用啦。
1766 2
|
4月前
|
Linux 虚拟化 开发者
一键将CentOs的yum源更换为国内阿里yum源
一键将CentOs的yum源更换为国内阿里yum源
6764 8
|
6月前
|
关系型数据库 MySQL Linux
在CentOS上使用yum安装与使用MySQL
在CentOS操作系统上使用yum包管理器安装和配置MySQL数据库的详细步骤,包括下载MySQL的yum源配置、安装MySQL服务、启动和停止服务、设置开机自启动、获取临时密码、修改root用户密码、授权用户以及处理相关问题。同时,文章还包含了一些操作的截图,帮助用户更直观地理解安装和配置过程。
1793 0
在CentOS上使用yum安装与使用MySQL
|
5月前
|
Linux Shell Python
centos执行pip3 install etcd3报错
centos执行pip3 install etcd3报错
|
5月前
|
Linux
centos使用阿里的yum源
centos使用阿里的yum源
|
6月前
|
缓存 Linux 网络安全
解决 CentOS 7 官方 yum 仓库无法使用的最佳实践
【8月更文挑战第18天】若 CentOS 7 的官方 YUM 仓库无法使用,可按以下步骤解决: 1. **检查网络连接**: - 确认服务器能正常上网,可通过访问外部网站或网络诊断测试。 - 检查防火墙设置,避免其阻挡 YUM 的网络访问。 2. **检查 YUM 配置**: - 核实 `/etc/yum.repos.d/` 下的 `CentOS-Base.repo` 文件中仓库地址正确无误。 - 确认配置文件内的 `enabled` 选项设为 `1` 以启用仓库。
2575 0
|
6月前
|
Linux Docker 容器
在CentOS操作系统上使用yum安装/使用/卸载Docker容器引擎
在CentOS操作系统上安装、配置、使用和卸载Docker容器引擎的详细步骤,包括配置Docker镜像加速的方法。
591 0
|
6月前
|
安全 Java 应用服务中间件
如何通过 Yum 在 CentOS 7 上安装 Apache Tomcat 7
如何通过 Yum 在 CentOS 7 上安装 Apache Tomcat 7
287 0