메모장

yum 명령어 실행 오류 (except KeyboardInterrupt, e:) 본문

OS/CentOS

yum 명령어 실행 오류 (except KeyboardInterrupt, e:)

hiandroid 2018. 1. 19. 09:01
반응형


이런 오류가 뜰 경우

[root@192 ~]# yum install subversion

  File "/bin/yum", line 30

    except KeyboardInterrupt, e:


1. python 확인

$ ls /usr/bin/python*

/usr/bin/python         /usr/bin/python2         /usr/bin/python2.7

/usr/bin/python-config  /usr/bin/python2-config  /usr/bin/python2.7-config


2. yum의 파이썬을 변경

$ gedit /usr/bin/yum

yum의 내용

#!/usr/bin/python      <<<----- 이부분을 위에 있는 파이썬으로 변경하고 저장(#!/usr/bin/python2.7)

import sys

try:

    import yum

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


Please install a package which provides 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, which is:

%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:

    import yummain

    yummain.user_main(sys.argv[1:], exit_code=True)

except KeyboardInterrupt, e:

    print >> sys.stderr, "\n\nExiting on user cancel."

    sys.exit(1)

반응형