LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   E: Sub-process /usr/bin/dpkg returned an error code (1) (https://www.linuxquestions.org/questions/linux-software-2/e-sub-process-usr-bin-dpkg-returned-an-error-code-1-a-642767/)

shogun1234 05-16-2008 06:39 PM

E: Sub-process /usr/bin/dpkg returned an error code (1)
 
I try to remove wesnoth-server package by using 'apt-get remove wesnoth-server'; but it fails. Then I searched on the forum regarding to this error message. Many people suggest either use apt-get -f install or dpkg --force-overwrite to eliminate this error; unfortunately, none of them work on my case.

when invoking the apt-get -f install it generates error
Code:

invoke-rc.d: initscript wesnoth-server, action "stop" failed
I search around in the /etc folder, finding out that there is a script called wesnoth-server located in the /etc/init.d/ dir; and is linked to different runlevel (e.g., rc2.d, etc.). I check the start-stop-daemon by command `which start-stop-daemon` with nothing returns. I believe the problem should be the incomplete state that apt-get record of wesnoth-server, in which related binary files has been removed but the record still exists in its package database. However, I have no idea where this record is located. Maybe I can edit it manually. Or how should I solve this problem?

I appreciate any suggestion.

Thank you very much.

shogun1234 05-17-2008 09:03 AM

Quote:

Originally Posted by shogun1234 (Post 3155777)
I try to remove wesnoth-server package by using 'apt-get remove wesnoth-server'; but it fails. Then I searched on the forum regarding to this error message. Many people suggest either use apt-get -f install or dpkg --force-overwrite to eliminate this error; unfortunately, none of them work on my case.

when invoking the apt-get -f install it generates error
Code:

invoke-rc.d: initscript wesnoth-server, action "stop" failed
I search around in the /etc folder, finding out that there is a script called wesnoth-server located in the /etc/init.d/ dir; and is linked to different runlevel (e.g., rc2.d, etc.). I check the start-stop-daemon by command `which start-stop-daemon` with nothing returns. I believe the problem should be the incomplete state that apt-get record of wesnoth-server, in which related binary files has been removed but the record still exists in its package database. However, I have no idea where this record is located. Maybe I can edit it manually. Or how should I solve this problem?

I appreciate any suggestion.

Thank you very much.


I think I found a solution (though might not be a good way). The problem cause this is error is from the place I am doubt of it. Because the installation calls the script wesnoth-server.prerm, located in the /var/lib/dpkg/info, to stop the wesnoth server first, in which the start-stop-daemon does not exists (no idea why). First I forcly install dpkg by extracting package and copy files to appropriate location (/sbin/start-stop-daemon), but it did not work. So I mark up the script which calls 'invokerc.d ...' and '/init.d/wesnoth-server' in wesnoth-server.prerm. Then do `apt-get remove wesnoth-server` again. Then this package is removed correctly.


All times are GMT -5. The time now is 03:50 PM.