maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Help, package remove error (https://talk.maemo.org/showthread.php?t=61729)

pinkfloyd 2010-09-05 02:53

Help, package remove error
 
Code:

Do you want to continue [Y/n]? y
(Reading database ... 102158 files and directories currently installed.)
Removing php5-common ...
dpkg (subprocess): unable to execute post-removal script: No such file or directory
dpkg: error processing php5-common (--remove):
 subprocess post-removal script returned error exit status 2
Errors were encountered while processing:
 php5-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
Nokia-N900-51-1:~#


Code:

Nokia-N900-51-1:~# apt-get remove php5-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  php5-common
0 upgraded, 0 newly installed, 1 to remove and 77 not upgraded.
1 not fully installed or removed.
After this operation, 537kB disk space will be freed.
Do you want to continue [Y/n]? y
dpkg: error processing php5-common (--remove):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
Errors were encountered while processing:
 php5-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
Nokia-N900-51-1:~#

Any clues how to fix this?

dchky 2010-09-05 05:26

Re: Help, package remove error
 
Do you have the file /var/lib/dpkg/info/php5-common.postrm ?

If not create one as follows - then try to remove php5-common again:

Code:

#! /bin/bash

set -e

if [ "$1" = "purge" ]
then
    rm -rf /var/lib/php5
fi

exit 0

If that doesn't work - then like the error message says - try to reinstall it, and then remove.

apt-get --reinstall install php5-common
apt-get --purge remove php5-comon

pinkfloyd 2010-09-05 06:06

Re: Help, package remove error
 
I do have the postrm script. But still i cant install upgrade or remove php5-common :/

Code:

Reading package lists... Done
Building dependency tree     
Reading state information... Done
The following packages were automatically installed and are no longer required:
  php5-common
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 77 not upgraded.
1 not fully installed or removed.
Need to get 0B/220kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 102154 files and directories currently installed.)
Preparing to replace php5-common 5.2.6-6maemo5 (using .../php5-common_5.2.6-6maemo5_armel.deb) ...
Unpacking replacement php5-common ...
dpkg (subprocess): unable to execute old post-removal script: No such file or directory
dpkg: warning - old post-removal script returned error exit status 2
dpkg - trying script from the new package instead ...
dpkg (subprocess): unable to execute new post-removal script: No such file or directory
dpkg: error processing /var/cache/apt/archives/php5-common_5.2.6-6maemo5_armel.deb (--unpack):
 subprocess new post-removal script returned error exit status 2
dpkg (subprocess): unable to execute new post-removal script: No such file or directory
dpkg: error while cleaning up:
 subprocess post-removal script returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/php5-common_5.2.6-6maemo5_armel.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
/var/lib/dpkg/info #


pinkfloyd 2010-09-06 04:15

Re: Help, package remove error
 
Any other ideas? i cant find a way to fix this issue =(

Rob1n 2010-09-06 08:17

Re: Help, package remove error
 
If the post-removal script dchky posted above is the one that's actually being used, then it will only work if you have bash installed. Either install bash or change the first line of the script to read "#!/bin/sh" instead.

pinkfloyd 2010-09-06 11:47

Re: Help, package remove error
 
Thanks that solved it!!! I did not think about it!! lol
TY very much Rob1n

Bzzz 2010-10-20 03:30

Re: Help, package remove error
 
Same problem here.../var/lib/dpkg/info/php5-common.postrm was there, but with no bash installed...:rolleyes:

Thank you very much! :)

pursueky 2010-11-15 16:10

Re: Help, package remove error
 
great thx !!!
all of U

anapospastos 2010-11-27 18:22

Re: Help, package remove error
 
I installed tweakflashver package and for a reason I dont know why it got broke. When I m trying to remove it I ve got this message

Code:

dpkg: error processing tweakflashver (--remove):
Package is in a very bad inconsistent state - you should reinstall it before attempting a removal.
Errors were encountered while processing: tweakflashver
E: Sub-process /usr/bin/dpkg returned an error code (1)

and when Im trying to reinstall it this message

Code:

Preparing to replace tweakflashver 0.4.0-maemo1 (using .../tweakflashver_0.4.0-maemo1_armel.deb) ...
Unpacking replacement tweakflashver ...
dpkg: warning - old post-removal script returned error exit status 255
dpkg - trying script from the new package instead ...
dpkg: error processing /var/cache/apt/archives/tweakflashver_0.4.0-maemo1_armel.deb (--unpack):
subprocess new post-removal script returned error exit status 255
dpkg: error while cleaning up:
subprocess post-removal script returned error exit status 255
Processing triggers for catorise ...
###########################################################################################################################################################################Errors were encountered while processing:
/var/cache/apt/archives/tweakflashver_0.4.0-maemo1_armel.deb
Sub-process /usr/bin/dpkg returned an error code (1)

Can someone help me how to fix it?

edit: I solved my issue by doing a reboot, disabling extra-devel and trying to reinstall tweakflasher. It (re)installed and now it s working just nice.

sanotto 2011-08-23 03:44

Re: Help, package remove error
 
Just registered to say THX U One year later this answer (Change bash to sh) is still usefule kudos :)


All times are GMT. The time now is 20:34.

vBulletin® Version 3.8.8