Reply
Thread Tools
Posts: 42 | Thanked: 20 times | Joined on Jul 2010 @ Argentina
#1
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?

Last edited by pinkfloyd; 2010-09-05 at 03:44.
 

The Following User Says Thank You to pinkfloyd For This Useful Post:
dchky's Avatar
Posts: 549 | Thanked: 299 times | Joined on Jun 2010 @ Australian in the Philippines
#2
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
 
Posts: 42 | Thanked: 20 times | Joined on Jul 2010 @ Argentina
#3
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 #
 
Posts: 42 | Thanked: 20 times | Joined on Jul 2010 @ Argentina
#4
Any other ideas? i cant find a way to fix this issue =(
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#5
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.
 

The Following 6 Users Say Thank You to Rob1n For This Useful Post:
Posts: 42 | Thanked: 20 times | Joined on Jul 2010 @ Argentina
#6
Thanks that solved it!!! I did not think about it!! lol
TY very much Rob1n
 
Posts: 26 | Thanked: 17 times | Joined on Mar 2010
#7
Same problem here.../var/lib/dpkg/info/php5-common.postrm was there, but with no bash installed...

Thank you very much!
 
pursueky's Avatar
Posts: 191 | Thanked: 46 times | Joined on Jun 2010 @ NanJing China
#8
great thx !!!
all of U
 
anapospastos's Avatar
Posts: 552 | Thanked: 183 times | Joined on Oct 2009 @ Not decided
#9
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.
__________________
My name was Maemo, then it became Meego and now I'm getting a third one. I am Sailfish.

Last edited by anapospastos; 2010-11-27 at 21:13.
 
Posts: 2 | Thanked: 0 times | Joined on Aug 2011
#10
Just registered to say THX U One year later this answer (Change bash to sh) is still usefule kudos
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 15:46.