apport 오류로 인해 더 이상 apt-get을 사용하여 설치할 수 없습니다.

apport 오류로 인해 더 이상 apt-get을 사용하여 설치할 수 없습니다.

저는 Xubuntu(Ubuntu 14.04.2 LTS, 64비트) Virtual Box를 사용하여 Windows 7 PC에서 작업하고 있습니다. 최근에 'apt-get' 명령과 Software Updater를 사용하는 데 문제가 발생했습니다. 소프트웨어 업데이터가 업데이트 중 하나를 다운로드할 수 없습니다. apport 2.14.1-0ubuntu3.10이 있고 2.14.1-0ubuntu3.11을 설치하려고 하지만 실패합니다.

또한 'apt-get 업그레이드'와 같은 'apt-get' 또는 'dpkg' 명령을 입력하면 다음과 같은 오류가 발생합니다. 내가 무엇을 할 수 있는지 아는 사람이 있습니까?

Reading package lists...
Building 
dependency tree...
Reading state information...
The following packages will be upgraded:
  apport
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/180 kB of archives.
After this operation, 20.5 kB of additional disk space will be used.
Do you want to continue? [Y/n] (Reading database ... 314480 files and directories currently installed.)
Preparing to unpack .../apport_2.14.1-0ubuntu3.11_all.deb ...
initctl: Unknown job: apport
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
initctl: Unknown job: apport
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/apport_2.14.1-0ubuntu3.11_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/apport_2.14.1-0ubuntu3.11_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

답변1

방금 내 PC에서 Python 파일을 컴파일하려고 했는데 /usr/bin/pycleanpython3으로 컴파일했는데 동일한 오류가 발생했습니다. 반면 python2로 컴파일하면 오류가 없습니다.

따라서 기본 Python 버전을 python3으로 만드는 시스템에서 무언가를 변경한 것 같습니다.

다음과 같이 이 문제를 해결할 수 있습니다.

  • 명령을 실행 ls -l /usr/bin/python하고 출력을 확인합니다.
  • 파일이 /usr/bin/pythonpython3.x를 가리키는 경우 링크를 제거하고 python2에 대한 링크로 바꿉니다.

    sudo rm /usr/bin/python
    sudo ln -s /usr/bin/python2.7 /usr/bin/python
    

    이제 python2.7은 원래대로 시스템의 기본 Python 버전으로 돌아갑니다.

관련 정보