I was having an error doing normal ubuntu(18) updates related to ValueError: bad marshal data
I deleted pyc files in /usr as suggested but no joy. I tried removing and reinstalling python - but hit this problem:
jon@:/var/www/stats/pup$ sudo apt install --reinstall python3-apt
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
apport : Depends: python3-apport (>= 2.20.9-0ubuntu7.21) but 2.20.9-0ubuntu7.20 is to be installed
apport-gtk : Depends: python3-apport (>= 2.20.9-0ubuntu7.21) but 2.20.9-0ubuntu7.20 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I tried apt --fix-broken install but this fails:
(Reading database ... 320885 files and directories currently installed.)
Preparing to unpack .../python3-apport_2.20.9-0ubuntu7.21_all.deb ...
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1159, in _install
ValueError: bad marshal data (unknown type code)
Fatal Python error: Py_Initialize: importlib install failed
Current thread 0x00007fd7fedd1740 (most recent call first):
Aborted
dpkg: warning: old python3-apport package pre-removal script subprocess returned error exit status 134
dpkg: trying script from the new package instead ...
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1159, in _install
ValueError: bad marshal data (unknown type code)
Fatal Python error: Py_Initialize: importlib install failed
Current thread 0x00007f5f2bcdf740 (most recent call first):
Aborted
dpkg: error processing archive /var/cache/apt/archives/python3-apport_2.20.9-0ubuntu7.21_all.deb (--unpack):
new python3-apport package pre-removal script subprocess returned error exit status 134
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1159, in _install
ValueError: bad marshal data (unknown type code)
Fatal Python error: Py_Initialize: importlib install failed
Current thread 0x00007faebc356740 (most recent call first):
Aborted
dpkg: error while cleaning up:
installed python3-apport package post-installation script subprocess returned error exit status 134
Errors were encountered while processing:
/var/cache/apt/archives/python3-apport_2.20.9-0ubuntu7.21_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies. apport : Depends: python3-apport (>= 2.20.9-0ubuntu7.21) but 2.20.9-0ubuntu7.20 is to be installed – jons Jan 04 '21 at 10:51