ubuntu 18.04 apt-get update error

1

I tried to update my ubuntu instance but i get the following error.

OK:1 http://packages.microsoft.com/repos/vscode stable InRelease                            
OK:2 http://security.ubuntu.com/ubuntu bionic-security InRelease                            
OK:3 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease                            
OK:4 http://us.archive.ubuntu.com/ubuntu bionic InRelease                                   
OK:5 https://download.mono-project.com/repo/ubuntu stable-bionic                 InRelease   
OK:7 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
Holen:6 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]
Holen:8 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [266 kB]     
Holen:9 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [245 kB]      
Holen:10 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [138 kB]
Holen:11 http://us.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [31,4 kB]
Holen:12 http://us.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [53,7 kB]
Holen:13 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [138 kB]
Holen:14 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [138 kB] 
Holen:15 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [145 kB]
Holen:16 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [153 kB]
Holen:17 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [262 kB]
Holen:18 http://us.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2.468 B]
Es wurden 1.104 kB in 31 s geholt (35,3 kB/s).                                              
Fehler: Zeitüberschreitung wurde erreicht
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
ImportError: dynamic module does not define module export function (PyInit_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
ImportError: dynamic module does not define module export function     (PyInit_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
ImportError: dynamic module does not define module export function     (PyInit_apt_pkg)
Paketlisten werden gelesen... Fertig
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

Additional error shows when i upgrade the dependencies.

apt-extracttemplates: error while loading shared libraries: /usr/lib/x86_64-linux-gnu/libapt-inst.so.2.0: invalid ELF header debconf: apt-extracttemplates schlug fehl: No such file or directory Extrahiere Vorlagen aus Paketen: 13%apt-extracttemplates: error while loading shared libraries: /usr/lib/x86_64-linux-gnu/libapt-inst.so.2.0: invalid ELF header

Marcel Rösler

Posted 2018-07-27T08:18:14.467

Reputation: 11

It spit's out a timeout (Fehler: Zeitüberschreitung...). Maybe switch to a apt-pool in germany if that is where you are located. – Nordlys Jeger – 2018-07-27T13:26:57.440

I switched the pool, but the error remains. – Marcel Rösler – 2018-08-01T11:08:00.880

Have you tried apt autoclean? Try commenting out anything in your sources.list except deb http://de.archive.ubuntu.com/ubuntu/ bionic main. After that please update your question with the output from apt update. – Nordlys Jeger – 2018-08-04T23:31:31.363

Another option is to backup your old sources.list and creating a new one with this content.

– Nordlys Jeger – 2018-08-04T23:34:04.190

No answers