Even run "sudo apt-get -f install" I got this error. Can't understand why?

      ValueError: bad marshal data (unknown type code)
      dpkg: error while cleaning up:
      subprocess installed post-installation script returned error exit status 1
      Errors were encountered while processing:
  • What are you trying to install?
    – Bex
    Commented Sep 1, 2014 at 18:03

3 Answers 3


Try not using the -f flag. It attempts to "fix-broken" to deduce what isn't working and either eliminate it or perform some other action. It should really only be used if you're troubleshooting a bad package install or some other installation issue. A normal package install should be of the type:

sudo apt-get install package

It would help if you listed the package you were actually trying to install, though.

Listed in the error was this package:


So perhaps try deleting that file (or moving it to another location, say /tmp) and rerun your install. If aptitude has downloaded that deb file (but it is corrupt) it could be trying to install it as a dependency. You may also delete that file and try to install "python-gi" again, or whatever that package's name is.


Put -f (if that is the software you want to install) after the install. Like this, sudo apt-get install -f


Does this happen with all software? Is your initial Raspbian image corrupted maybe? Have you checked the hash of the downloaded image?

If not, this thread may be of some use:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.