E: Sub-process /usr/bin/dpkg returned an error code (1)

Debian 有很多實用的工具如: apt 系列 、 update- 系列,但是我們卻常常忽略了!這個版就是要大家一起來分享您在使用 debian 特殊指令的經驗!請大家共襄盛舉囉!注意不要在此提問問題喔!

E: Sub-process /usr/bin/dpkg returned an error code (1)

文章訪客 » 週六 5月 17, 2008 10:27 pm

Just a quick remind on how to solve a problem I encountered lately. Though that might not be a big deal for specialist, it does cost me a few days labour because neither can I re-install (apt-get -f install ) nor remove (apt-get remove) package in order to patch openssl security hole.

Package that goes wrong is wesnoth-server.

Error message that throws as title indicates indeed does not help at all. I search around the internet and forums as I can. Some suggest to run 'apt-get clean,' which would clean /var/cache/apt/archives/ folders; others 'apt-get --purge <package-name>'. Unfortunately the message still sits there.

The error in fact comes from the script (/var/lib/dpkg/info/wesnoth-server.prerm) trying to stop the wesnoth-server first before reinstall the package; where it performs action `invoke-rc.d: initscript wesnoth-server, action "stop" failed.` that cause the error, in which it would either call wesnoth-server located in the /etc/init.d/wesnoth-server script or use start-stop-daemon to stop the server.

So the way to get around it is simply to mark out these two lines
代碼: 選擇全部
                invoke-rc.d wesnoth-server stop || exit $?

代碼: 選擇全部
                /etc/init.d/wesnoth-server stop || exit $?

in /var/lib/info/dpkg/info/wesnoth-server.prerm. Then the update/ upgrade should work as it were.

hope that helps,
訪客
 

回到 debian command

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客