[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to remove a broken package (solved)



"Charles Lewis" <lewisc@swau.edu> writes:

[...]
> After banging my head on this problem and becoming quite intimate with the
> different options of dpkg and apt-get, I discovered what the problem was. In
> order to disable apache, squid ,etc, one of my coworkers had added the line
> 'exit 1' at the beginning of the scripts in /etc/init.d. Somehow this
> effectively disabled the removal/purge process. After removing this line,
> everything went smoothly. Grief, is mind expansion always this painful?

Heh, yes, that makes perfect sense.  

Jusy FYI, When you try to remove a package, dpkg runs
<packagename>.prerm, a maintainer-supplied script or program that
cleans up for you before letting dpkg remove the package.

Part of that cleanup frequently involves running "init.d/<whatever>
stop" to be sure the about-to-be-removed daemons aren't still running.

(Since you have every right to edit the init.d scripts, you could
claim this is a bug in that pre-removal script -- perhaps it should
just warn you that the "stop" script didn't complete successfully
(i.e.  didn't exit with 0), and allow you to proceed with the removal
anyway.  Then again, the package maintainer could say "you broke it,
so you own both pieces."

The real fault is with whomever edited that script; had s/he put "exit
0" at the top instead of "exit 1", everyone would have been happy.
(Exit 0 means OK, and anything else means there was an error.)


Reply to: