본문 바로가기

Linux

RHEL8 - yum or dnf import Error

반응형

1. yum import Error

- 증상 : 모든 yum 명령어 실행시 아래와 같은 error log 발생

- 관련문서(RHEL Docs) : https://access.redhat.com/solutions/6212311

 

When yum or dnf command execute, ImportError occurs - Red Hat Customer Portal

The following ImportError occurs when executing yum or dnf commands and fails: # yum repolist Traceback (most recent call last): File "/usr/lib64/python3.6/site-packages/libdnf/error.py", line 14, in swig_import_helper return importlib.import_module(mname)

access.redhat.com

- 원인 :

  • This issue Occurs when other libraries referenced by the library where Import Error occurred are not normally referenced.

- 해결 방법 : 환경변수 LD_LIBARY_PATH에 문제가 되는 경로를 삭제, 또는 해당 환경변수가 비어있는 계정에서 yum 실행

  • If LD_LIBRARY_PATH is set, then remove it and try to run yum or dnf.
  • Verify that all libraries referenced by the library where the Import Error occurred are OK with the ldd command.
  • Check the strace log for yum or library information referenced when running dnf.

반응형