Code // Design // Art

Exec format error : package failed to install/remove : installation/removal script returned error exit status 2

I recently got an error while apt-get updating.
Exec format error : package failed to install/remove : installation/removal script returned error exit status 2
This was caused by a broken package, broken by a system crash while updating.

Here are two easy ways to fix it:

Way A: Remove the package and reinstall where PACKAGE == your broken package

$ sudo rm /var/lib/dpkg/info/PACKAGE_VERSION.p*
$ sudo apt-get remove --purge PACKAGE
$ sudo apt-get clean
$ sudo apt-get update

It will remove the broken package info and clean up your list.

Way B: When the package can’t be removed

$ sudo apt-get clean
$ sudo aptitude download PACKAGE
$ sudo dpkg --unpack ./PACKAGE_VERSION.deb
$ sudo dpkg --configure PACKAGE

Cheers

Leave a Reply

You must be logged in to post a comment.