컴퓨터/우분투2015. 8. 23. 03:29

Ubuntu 에서 사용하지 않는 nvidia 드라이버를 삭제할 때 오류만 발생하고 패키지가 삭제 되지 않는 경우, 아래와 같이 해결하자.

오류 메시지:

Traceback (most recent call last):
  File "/usr/bin/quirks-handler", line 65, in <module>
    operation_status = main(options)
  File "/usr/bin/quirks-handler", line 48, in main
    quirks = Quirks.quirkapplier.QuirkChecker(options.package_disable, path=quirks_path)
  File "/usr/lib/python3/dist-packages/Quirks/quirkapplier.py", line 38, in __init__
    self._system_info = self.get_system_info()
  File "/usr/lib/python3/dist-packages/Quirks/quirkapplier.py", line 64, in get_system_info
    return quirk_info.get_dmi_info()
  File "/usr/lib/python3/dist-packages/Quirks/quirkinfo.py", line 46, in get_dmi_info
    'class', 'dmi', 'id', item)).read().strip()
  File "/usr/lib/python3.4/codecs.py", line 313, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte


수정해야 할 부분(/usr/lib/python3/dist-packages/Quirks/quirkinfo.py):

value = open(os.path.join(self.sys_dir,
    'class', 'dmi', 'id', item)).read().strip()


수정 후:

value = open(os.path.join(self.sys_dir,
    'class', 'dmi', 'id', item), mode='rb').read().strip()


Posted by jungtae17