Ubuntu

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

Reported by Jean-Baptiste Lallement on 2010-01-24
This bug affects 567 people
Affects Status Importance Assigned to Milestone
dpkg (Debian)
Fix Released
Unknown
dpkg (Ubuntu)
High
Unassigned
Karmic
Undecided
Unassigned

Bug Description

Under some conditions package installation/upgrade/removal fails with the following error:

-- Error during installation --
Setting up screenlets (0.1.2-7) ...
dpkg (subprocess): unable to execute installed post-installation script: Exec format error
dpkg: error processing screenlets (--configure):
 subprocess installed post-installation script returned error exit status 2

-- Error during removal --
Removing gnome-do ...
dpkg (subprocess): unable to execute installed pre-removal script: Exec format error
dpkg: error processing gnome-do (--purge):
 subprocess installed pre-removal script returned error exit status 2

This error occurs when one of the installation or removal scripts (/var/lib/dpkg/info/PACKAGE.p*) is empty or corrupted.

== HOW TO REPRODUCE ==
Install a package and emulates a system crash before 30 seconds:
# apt-get install hello; sleep 20; echo b > /proc/sysrq-trigger
[simulates a system crash]
After reboot both installation and removal scripts are 0 bytes. You will notice that hello.list was correctly written to disk because of the fsync call in dpkg/src/filesdb.c
$ ls -l /var/lib/dpkg/info/hello.*
-rw-r--r-- 1 root root 323 2010-02-09 00:42 /var/lib/dpkg/info/hello.list
-rwxr-xr-x 1 root root 0 2009-08-15 19:17 /var/lib/dpkg/info/hello.postinst
-rwxr-xr-x 1 root root 0 2009-08-15 19:17 /var/lib/dpkg/info/hello.prerm

If you replay the test but adding a sync before the system crash:
# apt-get install hello; sync; echo b > /proc/sysrq-trigger
After reboot the files are fine:
$ ls -l /var/lib/dpkg/info/hello.*
-rw-r--r-- 1 root root 323 2010-02-09 00:46 /var/lib/dpkg/info/hello.list
-rwxr-xr-x 1 root root 103 2009-08-15 19:17 /var/lib/dpkg/info/hello.postinst
-rwxr-xr-x 1 root root 74 2009-08-15 19:17 /var/lib/dpkg/info/hello.prerm

If I adjust /proc/sys/vm/dirty_expire_centisecs to be below the sleep time, ( for exemple 1000 in the test above ) then data are correctly written to disk.

== WORKAROUNDS ==
Execute the following commands in a terminal
(GNOME: Applications -> Accessories -> Terminal
 KDE: KMenu -> Applications -> System -> Terminal [Konsole] )

Workaround A: Remove the package and reinstall

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

Then reinstall the package

Workaround B: Finish the install 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

Replace PACKAGE with the package name which fails to install/remove.

== Localization ==
The same error in non-english language:
 . fr: Erreur de format pour exec()
 . Error de formato ejecutable
 . Errore di formato di exec
 . en: Exec format error
 . hu: Érvénytelen végrehajtható fájlformátum
 . Exec formátum hiba
 . nl: Verkeerd uitvoerbaar bestand
 . Exec 格式错误
 . sv: Formatfel på körbar fil
 . fi: Käynnistettävän tiedoston muoto virheellinen
 . zh_CN: 可执行文件格式错误
 . ja: 実行形式エラー
 . ru: Ошибка формата выполняемого файла
 . es: Formato de ejecutable incorrecto
 . ca: L’executable té un format erroni
 . it: Formato eseguibile non valido
 . de: Fehler im Format der Programmdatei
 . pt: Erro de formato de executável
 . pt_BR: Erro no formato exec
 . da: Ugyldigt format på eksekverbar fil
More localizations can be found at https://translations.launchpad.net/ubuntu/lucid/+source/eglibc/+pots/

tags: added: bugpattern-needed
description: updated
description: updated
Philip Muškovac (yofel) on 2010-01-25
description: updated
shankao (shankao) on 2010-01-26
tags: added: metabug
Changed in dpkg (Debian):
status: Unknown → New
description: updated
Jean-Baptiste Lallement (jibel) wrote :

Here is a patch proposal which add some fsync on files and directories to prevent delayed allocation and the zero-length file problem after a system crash.

Changed in dpkg (Ubuntu):
assignee: nobody → Jean-Baptiste Lallement (jibel)
assignee: Jean-Baptiste Lallement (jibel) → nobody
importance: Undecided → High
status: New → Triaged
assignee: nobody → Jean-Baptiste Lallement (jibel)
Jean-Baptiste Lallement (jibel) wrote :

u-m-s team please wait before reviewing the patch, work is still in progress with upstream to push the fix in Debian. I'll provide another patch once it's done. Thanks.

Changed in dpkg (Ubuntu):
status: Triaged → In Progress
Colin Watson (cjwatson) wrote :

I've unsubscribed ubuntu-main-sponsors for now. Please feel free to resubscribe once something has been merged upstream that we can backport.

tags: added: patch
Download full text (3.6 KiB)

in my openion " so many bugs are 9.10 than 9.04" am i right?

On Mon, Mar 1, 2010 at 5:00 PM, Brian Murray <email address hidden> wrote:

> ** Tags added: patch
>
> --
> [MASTER] Exec format error : package failed to install/remove :
> installation/removal script returned error exit status 2
> https://bugs.launchpad.net/bugs/512096
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>
> Status in “dpkg” package in Ubuntu: In Progress
> Status in “dpkg” package in Debian: New
>
> Bug description:
> Under some conditions package installation/upgrade/removal fails with the
> following error:
>
> -- Error during installation --
> Setting up screenlets (0.1.2-7) ...
> dpkg (subprocess): unable to execute installed post-installation script:
> Exec format error
> dpkg: error processing screenlets (--configure):
> subprocess installed post-installation script returned error exit status 2
>
> -- Error during removal --
> Removing gnome-do ...
> dpkg (subprocess): unable to execute installed pre-removal script: Exec
> format error
> dpkg: error processing gnome-do (--purge):
> subprocess installed pre-removal script returned error exit status 2
>
> This error occurs when one of the installation or removal scripts
> (/var/lib/dpkg/info/PACKAGE.p*) is empty or corrupted.
>
> == HOW TO REPRODUCE ==
> Install a package and emulates a system crash before 30 seconds:
> # apt-get install hello; sleep 20; echo b > /proc/sysrq-trigger
> [simulates a system crash]
> After reboot both installation and removal scripts are 0 bytes. You will
> notice that hello.list was correctly written to disk because of the fsync
> call in dpkg/src/filesdb.c
> $ ls -l /var/lib/dpkg/info/hello.*
> -rw-r--r-- 1 root root 323 2010-02-09 00:42 /var/lib/dpkg/info/hello.list
> -rwxr-xr-x 1 root root 0 2009-08-15 19:17
> /var/lib/dpkg/info/hello.postinst
> -rwxr-xr-x 1 root root 0 2009-08-15 19:17 /var/lib/dpkg/info/hello.prerm
>
> If you replay the test but adding a sync before the system crash:
> # apt-get install hello; sync; echo b > /proc/sysrq-trigger
> After reboot the files are fine:
> $ ls -l /var/lib/dpkg/info/hello.*
> -rw-r--r-- 1 root root 323 2010-02-09 00:46 /var/lib/dpkg/info/hello.list
> -rwxr-xr-x 1 root root 103 2009-08-15 19:17
> /var/lib/dpkg/info/hello.postinst
> -rwxr-xr-x 1 root root 74 2009-08-15 19:17 /var/lib/dpkg/info/hello.prerm
>
> If I adjust /proc/sys/vm/dirty_expire_centisecs to be below the sleep time,
> ( for exemple 1000 in the test above ) then data are correctly written to
> disk.
>
> == WORKAROUNDS ==
> Execute the following commands in a terminal
> (GNOME: Applications -> Accessories -> Terminal
> KDE: KMenu -> Applications -> System -> Terminal [Konsole] )
>
> Workaround A: Remove the package and reinstall
>
> $ sudo rm /var/lib/dpkg/info/PACKAGE_VERSION.p*
> $ sudo apt-get remove --purge PACKAGE
> $ sudo apt-get clean
> $ sudo apt-get update
>
> Then reinstall the package
>
> Workaround B: Finish the install 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
>
> Replace PACKAGE...

Read more...

tags: added: patch-upstreaminput
removed: patch
Tony B (tonesbox) wrote :
Download full text (5.4 KiB)

Hello Mr Murray,

Thank you very much for your email. I'm not sure I understand much of it but
I ran *sudo rm /var/lib/dpkg/info/PACKAGE_VERSION.p* in accordance with your
"workaround" suggestion A to remove the package, but I got the message that
no such file or directory exists. So then I went to your workaround
alternative B to be used when package can't be removed. I got the following
printout:-*

tony@tony-laptop:~$ sudo rm /var/lib/dpkg/info/PACKAGE_VERSION.p*
[sudo] password for tony:
rm: cannot remove `/var/lib/dpkg/info/PACKAGE_VERSION.p*': No such file or
directory
tony@tony-laptop:~$ sudo apt-get clean
[sudo] password for tony:
tony@tony-laptop:~$ sudo aptitude download PACKAGE
Reading package lists... Done
Building dependency tree
Reading state information... Done
Initialising package states... Done
Writing extended state information... Done
E: Can't find a package named "PACKAGE"
tony@tony-laptop:~$ sudo dpkg --unpack./PACKAGE_VERSION.deb
dpkg: unknown option --unpack./PACKAGE_VERSION.deb

Type dpkg --help for help about installing and deinstalling packages [*];
Use `dselect' or `aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;
Type dpkg --license|--licence for copyright licence and lack of warranty
(GNU GPL) [*].

Options marked [*] produce a lot of output - pipe it through `less' or
`more' !
tony@tony-laptop:~$ sudo dpkg --configure PACKAGE
dpkg: error processing package (--configure):
 no package named `package' is installed, cannot configure
Errors were encountered while processing:
 package
tony@tony-laptop:~$

I think I've probably done something wrong, haven't I?

Regards,
Tony Boulind

On 5 March 2010 23:43, Brian Murray <email address hidden> wrote:

> ** Tags added: patch-upstreaminput
> ** Tags removed: patch
>
> --
> [MASTER] Exec format error : package failed to install/remove :
> installation/removal script returned error exit status 2
> https://bugs.launchpad.net/bugs/512096
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>
> Status in “dpkg” package in Ubuntu: In Progress
> Status in “dpkg” package in Debian: New
>
> Bug description:
> Under some conditions package installation/upgrade/removal fails with the
> following error:
>
> -- Error during installation --
> Setting up screenlets (0.1.2-7) ...
> dpkg (subprocess): unable to execute installed post-installation script:
> Exec format error
> dpkg: error processing screenlets (--configure):
> subprocess installed post-installation script returned error exit status 2
>
> -- Error during removal --
> Removing gnome-do ...
> dpkg (subprocess): unable to execute installed pre-removal script: Exec
> format error
> dpkg: error processing gnome-do (--purge):
> subprocess installed pre-removal script returned error exit status 2
>
> This error occurs when one of the installation or removal scripts
> (/var/lib/dpkg/info/PACKAGE.p*) is empty or corrupted.
>
> == HOW TO REPRODUCE ==
> Install a package and emulates a system crash before 30 seconds:
> # apt-ge...

Read more...

Download full text (9.9 KiB)

You must instead of PACKAGE the name of your package which you are problems.

> Date: Sun, 7 Mar 2010 15:22:40 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: Re: [Bug 512096] Re: [MASTER] Exec format error : package failed to install/remove : installation/removal script returned error exit status 2
>
> Hello Mr Murray,
>
> Thank you very much for your email. I'm not sure I understand much of it but
> I ran *sudo rm /var/lib/dpkg/info/PACKAGE_VERSION.p* in accordance with your
> "workaround" suggestion A to remove the package, but I got the message that
> no such file or directory exists. So then I went to your workaround
> alternative B to be used when package can't be removed. I got the following
> printout:-*
>
>
> tony@tony-laptop:~$ sudo rm /var/lib/dpkg/info/PACKAGE_VERSION.p*
> [sudo] password for tony:
> rm: cannot remove `/var/lib/dpkg/info/PACKAGE_VERSION.p*': No such file or
> directory
> tony@tony-laptop:~$ sudo apt-get clean
> [sudo] password for tony:
> tony@tony-laptop:~$ sudo aptitude download PACKAGE
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Initialising package states... Done
> Writing extended state information... Done
> E: Can't find a package named "PACKAGE"
> tony@tony-laptop:~$ sudo dpkg --unpack./PACKAGE_VERSION.deb
> dpkg: unknown option --unpack./PACKAGE_VERSION.deb
>
> Type dpkg --help for help about installing and deinstalling packages [*];
> Use `dselect' or `aptitude' for user-friendly package management;
> Type dpkg -Dhelp for a list of dpkg debug flag values;
> Type dpkg --force-help for a list of forcing options;
> Type dpkg-deb --help for help about manipulating *.deb files;
> Type dpkg --license|--licence for copyright licence and lack of warranty
> (GNU GPL) [*].
>
> Options marked [*] produce a lot of output - pipe it through `less' or
> `more' !
> tony@tony-laptop:~$ sudo dpkg --configure PACKAGE
> dpkg: error processing package (--configure):
> no package named `package' is installed, cannot configure
> Errors were encountered while processing:
> package
> tony@tony-laptop:~$
>
>
> I think I've probably done something wrong, haven't I?
>
> Regards,
> Tony Boulind
>
> On 5 March 2010 23:43, Brian Murray <email address hidden> wrote:
>
> > ** Tags added: patch-upstreaminput
> > ** Tags removed: patch
> >
> > --
> > [MASTER] Exec format error : package failed to install/remove :
> > installation/removal script returned error exit status 2
> > https://bugs.launchpad.net/bugs/512096
> > You received this bug notification because you are a direct subscriber
> > of a duplicate bug.
> >
> > Status in “dpkg” package in Ubuntu: In Progress
> > Status in “dpkg” package in Debian: New
> >
> > Bug description:
> > Under some conditions package installation/upgrade/removal fails with the
> > following error:
> >
> > -- Error during installation --
> > Setting up screenlets (0.1.2-7) ...
> > dpkg (subprocess): unable to execute installed post-installation script:
> > Exec format error
> > dpkg: error processing screenlets (--configure):
> > subprocess ins...

Colin Watson (cjwatson) wrote :

A change to use fsync has been committed upstream; I'll deal with backporting it to Lucid.

Jean-Baptiste Lallement (jibel) wrote :

Tests done with the latest git and bzr revisions are positives. The only thing that remains is that the file status-new is not synced to status. This is a minor a annoyance since running 'dpkg --configure -a' after the crash will correct the error.

There is a performance impact of a factor 2 (2 times slower) on installation and upgrade of a package.
It would be great if additional testing could be done.

I agree that (subjectively - I haven't timed it) it seems somewhat
slower. Correctness over performance, though, so I'm going to go ahead
with this for Lucid at the moment - we can backport additional
performance fixes as they're done upstream.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dpkg - 1.15.5.6ubuntu2

---------------
dpkg (1.15.5.6ubuntu2) lucid; urgency=high

  * Backport from upstream:
    - Use FIEMAP when available (on Linux based systems) to sort the .list
      files loading order. With a cold cache it improves up to a 70%.
      Thanks to Morten Hustveit <email address hidden>. LP: #442114
    - Call fsync(2) after writing files on disk, to get the atomicity
      guarantees when doing rename(2). Based on a patch by Jean-Baptiste
      Lallement <email address hidden>.
      Closes: #430958, LP: #512096
  * Security fixes by Raphaël Hertzog, also backported from upstream
    (CVE-2010-0396):
    - Modify dpkg-source to error out when it would apply patches containing
      insecure paths (with "/../") and also error out when it would apply a
      patch through a symlink. Those checks are required as patch will
      happily modify files outside of the target directory and unpacking a
      source package should not be able to have any side-effect outside of
      the target directory. LP: #532445
    - Also error out when the quilt series contains a path with "/../" as
      this can cause patch to create files outside of the source package due
      to the -B .pc/$path option that it gets.
 -- Colin Watson <email address hidden> Thu, 11 Mar 2010 00:34:28 +0000

Changed in dpkg (Ubuntu):
status: In Progress → Fix Released
Changed in dpkg (Debian):
status: New → Fix Released
anoop (pv-anoop-pv) on 2010-04-01
Changed in dpkg (Ubuntu):
status: Fix Released → Confirmed
Colin Watson (cjwatson) wrote :

anoop: When you reopen a bug, you must explain why - otherwise we'll close it again (like this).

Changed in dpkg (Ubuntu):
status: Confirmed → Fix Released
Philip Muškovac (yofel) wrote :

According to the changelog the patch was reverted to fix bug 537241. (fsync making dpkg too slow)

dpkg (1.15.5.6ubuntu3) lucid; urgency=low

  * Revert fsync during package unpack for now; it's unacceptably slow for
    packages with lots of small files, and we can't ship beta-1 this way.
    We'll do something better once it's decided upstream (LP: #537241).
 -- Colin Watson <email address hidden> Tue, 16 Mar 2010 10:04:38 +0000

Changed in dpkg (Ubuntu):
status: Fix Released → Triaged
Colin Watson (cjwatson) wrote :

Philip, only one small part of the patch was reverted, and that part shouldn't have been relevant to the error that's the subject of this bug.

Changed in dpkg (Ubuntu):
status: Triaged → Fix Released
Martin Pitt (pitti) wrote :

> I agree that (subjectively - I haven't timed it) it seems somewhat slower.

Just to throw in some numbers for comparison:

$ sudo time dpkg -i /var/cache/apt/archives/openoffice.org-common_1%3a3.2.0-7ubuntu3_all.deb
-> 64 s
$ sudo time /home/dchroot/karmic/usr/bin/dpkg -i /var/cache/apt/archives/openoffice.org-common_1%3a3.2.0-7ubuntu3_all.deb
-> 21 s

given that the 5 triggers alone take some 10 s, this is a times-5 performance penalty (and load goes to 1.8 in the first run, which makes the machine quite sluggish).

But of course correctness > performance.

Colin Watson (cjwatson) wrote :

Ideally there would be some way to interrogate the kernel to discover
whether we need to do this rubbish for a given filesystem.

Changed in dpkg (Ubuntu):
status: Fix Released → Fix Committed
Changed in dpkg (Ubuntu):
status: Fix Committed → Fix Released

reopening due to recent cases in lucid.
Only maintainer scripts are affected by this problem, data files are correctly synced.

Changed in dpkg (Ubuntu):
assignee: Jean-Baptiste Lallement (jibel) → nobody
status: Fix Released → Triaged
description: updated
pmp6nl (pmp6nl) wrote :

Workaround A worked on:

bzr
bzrtools
python-dateutil
python-gnomedesktop
python-gweather
python-paramiko
python-vobject

Thank you very much!!! :D

Raghav Sethi (raghavsethi62) wrote :

Workaround A works awesomely! :D

Thank you all very much! :D

ibrahim.k (bero-hacker) wrote :

I don't Understand anything :(

2010/6/9 ibrahim.k <email address hidden>

> I don't Understand anything :(
>
>
no worries, case is resolved, the reply was just a "thank-you" to your
fantastic support!!!!

Kind regards,
Xian

Behrooz Amoozad (behrooz0az) wrote :

I'm new to Linux and don't understand anything.
last line before hang is:
Preparing to replace mysql-server-5.1 5.1.41-3ubuntu12.1 (using .../mysql-server-5.1_5.1.41-3ubuntu12.3_amd64.deb) ...

what should i exactly do?
I cannot install anything.I'm trying any dpkg command for +7 days.
nothing helped me.somebody please help me.

maria rossi (iperbole10) wrote :

SOLVED :
1. Close Synaptic or any package manager. Wait for or cancel any updates or install\uninstall.
2. Make Backups of current /var/lib/dpkg/status file. Just copy and paste to your home directory or Desktop.
3. Alt+F2 and launch type in gksu gedit /var/lib/dpkg/status and run it. Gedit will be launched with a text file open.
4. Now, search for the exact name of the package with problems and find it.
5. In my case, it I found the entry for the package thunderbird: Half configurated : I'have deleted that information and Ive solved my problem.

milan_n (novotny-mila) wrote :

E: libboost-date-time1.40.0: sub-process installed post-removal script returned error status 2
E: libgtkglext1: sub-process installed post-removal script returned error status 2
E: libmagick++2: sub-process installed post-removal script returned error status 2

 sub-process /usr/bin/dpkg returned error code (1)

I tried to reinstal gimp only. Upper errors appeared and then I tried to remove some libs.
I need some advices to solving my problem.

I have Ubuntu 10.04 LTS - Lucid Lynx

enguerran (marsokod) on 2010-07-06
description: updated
Download full text (7.1 KiB)

Good Morning

I am trying to follow the work around instructions but not having full
success yet.

I am using libglew1.5 to replace PACKAGE and that works fine
what do I use to replace PACKAGE_VERSION?? I tried 1.5.2.0ubuntu1 but
that doesn't seem to work

Cheers
chipppy

On Tue, 2010-07-06 at 15:30 +0000, enguerran wrote:
> ** Description changed:
>
> Under some conditions package installation/upgrade/removal fails with
> the following error:
>
> -- Error during installation --
> Setting up screenlets (0.1.2-7) ...
> dpkg (subprocess): unable to execute installed post-installation script: Exec format error
> dpkg: error processing screenlets (--configure):
> subprocess installed post-installation script returned error exit status 2
>
> -- Error during removal --
> Removing gnome-do ...
> dpkg (subprocess): unable to execute installed pre-removal script: Exec format error
> dpkg: error processing gnome-do (--purge):
> subprocess installed pre-removal script returned error exit status 2
>
> This error occurs when one of the installation or removal scripts
> (/var/lib/dpkg/info/PACKAGE.p*) is empty or corrupted.
>
> == HOW TO REPRODUCE ==
> Install a package and emulates a system crash before 30 seconds:
> # apt-get install hello; sleep 20; echo b > /proc/sysrq-trigger
> [simulates a system crash]
> After reboot both installation and removal scripts are 0 bytes. You will notice that hello.list was correctly written to disk because of the fsync call in dpkg/src/filesdb.c
> $ ls -l /var/lib/dpkg/info/hello.*
> -rw-r--r-- 1 root root 323 2010-02-09 00:42 /var/lib/dpkg/info/hello.list
> -rwxr-xr-x 1 root root 0 2009-08-15 19:17 /var/lib/dpkg/info/hello.postinst
> -rwxr-xr-x 1 root root 0 2009-08-15 19:17 /var/lib/dpkg/info/hello.prerm
>
> If you replay the test but adding a sync before the system crash:
> # apt-get install hello; sync; echo b > /proc/sysrq-trigger
> After reboot the files are fine:
> $ ls -l /var/lib/dpkg/info/hello.*
> -rw-r--r-- 1 root root 323 2010-02-09 00:46 /var/lib/dpkg/info/hello.list
> -rwxr-xr-x 1 root root 103 2009-08-15 19:17 /var/lib/dpkg/info/hello.postinst
> -rwxr-xr-x 1 root root 74 2009-08-15 19:17 /var/lib/dpkg/info/hello.prerm
>
> If I adjust /proc/sys/vm/dirty_expire_centisecs to be below the sleep
> time, ( for exemple 1000 in the test above ) then data are correctly
> written to disk.
>
> == WORKAROUNDS ==
> Execute the following commands in a terminal
> (GNOME: Applications -> Accessories -> Terminal
> KDE: KMenu -> Applications -> System -> Terminal [Konsole] )
>
> Workaround A: Remove the package and reinstall
>
> $ sudo rm /var/lib/dpkg/info/PACKAGE_VERSION.p*
> $ sudo apt-get remove --purge PACKAGE
> $ sudo apt-get clean
> $ sudo apt-get update
>
> Then reinstall the package
>
> Workaround B: Finish the install 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
>
> Replace PACKAGE with the package name which fails to install/remove.
>
...

Read more...

Download full text (11.2 KiB)

hello

Thanks for the write up. But I cannot do a thing for the machine with
reported problem was stolen and now I am using a borrowed machine which runs
on windows. but thanks for the description you have depicted

chears
GM

On 7 July 2010 01:05, chipppy <email address hidden> wrote:

> Good Morning
>
> I am trying to follow the work around instructions but not having full
> success yet.
>
> I am using libglew1.5 to replace PACKAGE and that works fine
> what do I use to replace PACKAGE_VERSION?? I tried 1.5.2.0ubuntu1 but
> that doesn't seem to work
>
> Cheers
> chipppy
>
> On Tue, 2010-07-06 at 15:30 +0000, enguerran wrote:
> > ** Description changed:
> >
> > Under some conditions package installation/upgrade/removal fails with
> > the following error:
> >
> > -- Error during installation --
> > Setting up screenlets (0.1.2-7) ...
> > dpkg (subprocess): unable to execute installed post-installation
> script: Exec format error
> > dpkg: error processing screenlets (--configure):
> > subprocess installed post-installation script returned error exit
> status 2
> >
> > -- Error during removal --
> > Removing gnome-do ...
> > dpkg (subprocess): unable to execute installed pre-removal script: Exec
> format error
> > dpkg: error processing gnome-do (--purge):
> > subprocess installed pre-removal script returned error exit status 2
> >
> > This error occurs when one of the installation or removal scripts
> > (/var/lib/dpkg/info/PACKAGE.p*) is empty or corrupted.
> >
> > == HOW TO REPRODUCE ==
> > Install a package and emulates a system crash before 30 seconds:
> > # apt-get install hello; sleep 20; echo b > /proc/sysrq-trigger
> > [simulates a system crash]
> > After reboot both installation and removal scripts are 0 bytes. You
> will notice that hello.list was correctly written to disk because of the
> fsync call in dpkg/src/filesdb.c
> > $ ls -l /var/lib/dpkg/info/hello.*
> > -rw-r--r-- 1 root root 323 2010-02-09 00:42
> /var/lib/dpkg/info/hello.list
> > -rwxr-xr-x 1 root root 0 2009-08-15 19:17
> /var/lib/dpkg/info/hello.postinst
> > -rwxr-xr-x 1 root root 0 2009-08-15 19:17
> /var/lib/dpkg/info/hello.prerm
> >
> > If you replay the test but adding a sync before the system crash:
> > # apt-get install hello; sync; echo b > /proc/sysrq-trigger
> > After reboot the files are fine:
> > $ ls -l /var/lib/dpkg/info/hello.*
> > -rw-r--r-- 1 root root 323 2010-02-09 00:46
> /var/lib/dpkg/info/hello.list
> > -rwxr-xr-x 1 root root 103 2009-08-15 19:17
> /var/lib/dpkg/info/hello.postinst
> > -rwxr-xr-x 1 root root 74 2009-08-15 19:17
> /var/lib/dpkg/info/hello.prerm
> >
> > If I adjust /proc/sys/vm/dirty_expire_centisecs to be below the sleep
> > time, ( for exemple 1000 in the test above ) then data are correctly
> > written to disk.
> >
> > == WORKAROUNDS ==
> > Execute the following commands in a terminal
> > (GNOME: Applications -> Accessories -> Terminal
> > KDE: KMenu -> Applications -> System -> Terminal [Konsole] )
> >
> > Workaround A: Remove the package and reinstall
> >
> > $ sudo rm /var/lib/dpkg/info/PACKAGE_VERSION.p*
> > $ sudo apt-get remove -...

dYp (dubois-yaen-pujol) wrote :

hello,
thanks to maria rossi for the clue.
SOLVED :
1. Close Synaptic or any package manager. Wait for or cancel any updates or install\uninstall.
2. Make Backups of current /var/lib/dpkg/status file. Just copy and paste to your home directory or Desktop.
3. Alt+F2 and launch type in gksu gedit /var/lib/dpkg/status and run it. Gedit will be launched with a text file open.
4. Now, search for the exact name of the package with problems and find it.
5. In my case, it I found the entry for the package nfs-common and nfs-kernel: Half configurated
6. I have deleted that information and I've solved my problem.

papukaija (papukaija) on 2010-08-22
tags: added: patch
Raphaël Hertzog (hertzog) wrote :

Maverick and natty have the sync fixes.

Changed in dpkg (Ubuntu):
status: Triaged → Fix Released
Changed in dpkg (Ubuntu Karmic):
status: New → Confirmed
Download full text (3.9 KiB)

Thanx to everyone, ! this is a great group of engineers !

2011/3/9 Raphaël Hertzog <email address hidden>

> Maverick and natty have the sync fixes.
>
> ** Changed in: dpkg (Ubuntu)
> Status: Triaged => Fix Released
>
> ** Changed in: dpkg (Ubuntu Karmic)
> Status: New => Confirmed
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/512096
>
> Title:
> [MASTER] Exec format error : package failed to install/remove :
> installation/removal script returned error exit status 2
>
> Status in “dpkg” package in Ubuntu:
> Fix Released
> Status in “dpkg” source package in Karmic:
> Confirmed
> Status in “dpkg” package in Debian:
> Fix Released
>
> Bug description:
> Under some conditions package installation/upgrade/removal fails with
> the following error:
>
> -- Error during installation --
> Setting up screenlets (0.1.2-7) ...
> dpkg (subprocess): unable to execute installed post-installation script:
> Exec format error
> dpkg: error processing screenlets (--configure):
> subprocess installed post-installation script returned error exit status
> 2
>
> -- Error during removal --
> Removing gnome-do ...
> dpkg (subprocess): unable to execute installed pre-removal script: Exec
> format error
> dpkg: error processing gnome-do (--purge):
> subprocess installed pre-removal script returned error exit status 2
>
> This error occurs when one of the installation or removal scripts
> (/var/lib/dpkg/info/PACKAGE.p*) is empty or corrupted.
>
> == HOW TO REPRODUCE ==
> Install a package and emulates a system crash before 30 seconds:
> # apt-get install hello; sleep 20; echo b > /proc/sysrq-trigger
> [simulates a system crash]
> After reboot both installation and removal scripts are 0 bytes. You will
> notice that hello.list was correctly written to disk because of the fsync
> call in dpkg/src/filesdb.c
> $ ls -l /var/lib/dpkg/info/hello.*
> -rw-r--r-- 1 root root 323 2010-02-09 00:42 /var/lib/dpkg/info/hello.list
> -rwxr-xr-x 1 root root 0 2009-08-15 19:17
> /var/lib/dpkg/info/hello.postinst
> -rwxr-xr-x 1 root root 0 2009-08-15 19:17 /var/lib/dpkg/info/hello.prerm
>
> If you replay the test but adding a sync before the system crash:
> # apt-get install hello; sync; echo b > /proc/sysrq-trigger
> After reboot the files are fine:
> $ ls -l /var/lib/dpkg/info/hello.*
> -rw-r--r-- 1 root root 323 2010-02-09 00:46 /var/lib/dpkg/info/hello.list
> -rwxr-xr-x 1 root root 103 2009-08-15 19:17
> /var/lib/dpkg/info/hello.postinst
> -rwxr-xr-x 1 root root 74 2009-08-15 19:17 /var/lib/dpkg/info/hello.prerm
>
> If I adjust /proc/sys/vm/dirty_expire_centisecs to be below the sleep
> time, ( for exemple 1000 in the test above ) then data are correctly
> written to disk.
>
> == WORKAROUNDS ==
> Execute the following commands in a terminal
> (GNOME: Applications -> Accessories -> Terminal
> KDE: KMenu -> Applications -> System -> Terminal [Konsole] )
>
> Workaround A: Remove the package and reinstall
>
> $ sudo rm /var/lib/dpkg/info/PACKAGE_VERSION.p*
> $ sudo apt-get remove --purge PACKAGE
> $ sudo apt-get clean
> $ sudo apt-get upda...

Read more...

Changed in dpkg (Ubuntu Karmic):
status: Confirmed → Won't Fix
era (era) on 2011-03-29
description: updated
description: updated
tags: added: iso-testing
Francewhoa (francewhoa) wrote :

Confirming this issue. Same here upgrading from 8.04 to 10.04.1 caused the problem to appear.

All above solutions didn't work in my case. The following worked. In Terminal:

--------------------------------
sudo rm /var/lib/dpkg/info/flashplugin-nonfree.postinst
sudo rm /var/lib/dpkg/info/flashplugin-nonfree.postrm
sudo rm /var/lib/dpkg/info/flashplugin-nonfree.prerm
sudo dpkg --force all --purge flashplugin-nonfree
--------------------------------

Thanks to sandyd http://ubuntuforums.org/showpost.php?p=9072362&postcount=21

LinkedIn
------------

Bug,

I'd like to add you to my professional network on LinkedIn.

- George

George Mathew
Senior Lecturer at Ministry of Health
Botswana

Confirm that you know George Mathew:
https://www.linkedin.com/e/8uiuax-hs7glpjm-1z/isd/20467204759/MF7mktco/?hs=false&tok=1eedrXp7ayq681

--
You are receiving Invitation to Connect emails. Click to unsubscribe:
http://www.linkedin.com/e/8uiuax-hs7glpjm-1z/zrhXmwlvgPDaRuC2-gukkgxvqYSpweZpDOvz6YP/goo/512096%40bugs%2Elaunchpad%2Enet/20061/I6585190447_1/?hs=false&tok=0m0WSiNF2yq681

(c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.