손상된 PATH 변수를 다시 빌드한 후 apt-get 업데이트가 더 이상 작동하지 않습니다.

손상된 PATH 변수를 다시 빌드한 후 apt-get 업데이트가 더 이상 작동하지 않습니다.

PATH어젯밤에 변수를 완전히 망쳤는데 고맙게도 Icarus라는 사용자가 다시 빌드하는 데 도움을 주었습니다.여기.

그러나 아직 완전히 수정되지 않았으며 실행하려고 하면 이전 게시물과 동일한(또는 매우 유사한) 오류가 발생했습니다.sudo apt-get update

에러 메시지:

Hit:1 http://ppa.launchpad.net/geany-dev/ppa/ubuntu bionic InRelease
Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                                                    
Hit:3 http://ppa.launchpad.net/hvr/ghc/ubuntu bionic InRelease                                                                                       
Hit:4 http://gb.archive.ubuntu.com/ubuntu bionic InRelease                                                                                           
Hit:5 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease                                                                                   
Hit:6 http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu bionic InRelease                                                           
Hit:7 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease                                                                       
Hit:8 https://deb.nodesource.com/node_12.x bionic InRelease                                                                                
Hit:9 http://packages.microsoft.com/repos/vscode stable InRelease                                                    
Traceback (most recent call last):                 
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code

관련 정보