yum 安装报错 File “/usr/bin/yum“, line 30 except KeyboardInterrupt

编程入门 行业动态 更新时间:2024-10-28 20:24:48

yum 安装<a href=https://www.elefans.com/category/jswz/34/1771188.html style=报错 File “/usr/bin/yum“, line 30 except KeyboardInterrupt"/>

yum 安装报错 File “/usr/bin/yum“, line 30 except KeyboardInterrupt

在使用centos7将python从2.7升级到3.x时报的错,只需修改 /usr/bin/yum 和 /usr/libexec/urlgrabber-ext-down 文件,指定使用 python2.7 作为 yum 的解释器。

终端输入以下命令,按i修改文件,按esc退出修改,再输入:wq!保存并退出。

vim /usr/bin/yum

#!/usr/bin/python2.7
import sys
try:
    import yum
except ImportError:
    print >> sys.stderr, """\

vim /usr/libexec/urlgrabber-ext-down

 

#! /usr/bin/python2.7
#  A very simple external downloader
#  Copyright 2011-2012 Zdenek Pavlas

#   This library is free software; you can redistribute it and/or
#   modify it under the terms of the GNU Lesser General Public

更多推荐

yum 安装报错 File “/usr/bin/yum“, line 30 except KeyboardInterrupt

本文发布于:2024-02-05 10:35:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1744595.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报错   usr   File   yum   KeyboardInterrupt

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!