python3로 업그레이드 한 후 YUM을 실행했을 때, 에러가 발생하였다.
원인
/usr/bin/yum의 파일을 열어보니,
import yum을 하였을시 예외처리가 되어 있었다. python3에는 모듈이 없나보다.
#!/usr/bin/python
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)
pip로 설치를 해봤지만 모듈자체가 없는가 보다...
#pip install yum
Collecting yum
Could not find a version that satisfies the requirement yum (from versions: )
No matching distribution found for yum
# pip install yummain
Could not find a version that satisfies the requirement yummain (from versions: )
No matching distribution found for yummain
해결
/usr/bin/yum과 /usr/libexec/urlgrabber-ext-down의 인터프리터를 각각 2버전으로 정정
#!/usr/bin/python2
'Linux > RedHat, CentOS, ubuntu' 카테고리의 다른 글
[ CentOS 7 ] freetds를 이용하여 MSSQL에 연결 (0) | 2021.04.02 |
---|---|
apache httpd.conf 문법 검사 명령어 (0) | 2021.03.26 |
[CentOS] timezone 변경하기 (0) | 2020.03.24 |
CentOS7 mariadb port 변경 (0) | 2020.01.31 |
[리눅스 명령어] tee 표준입력으로부터 표준출력과 파일로 저장 (0) | 2019.11.25 |
CentOS 7 SFTP만 사용할 수 있는 계정 만들기 (0) | 2019.11.24 |
[ Centos 5 ~ 6 ] chkconfig를 이용하여 서비스 자동실행 등록 (0) | 2019.11.22 |
centos semanage 명령어 활성화 (0) | 2019.11.22 |