Bug#453404: removal of package fails when puppet is not running
I have a system where puppet is not running.
# apt-get remove puppet
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 1962kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 82071 files and directories currently installed.)
Removing puppet ...
invoke-rc.d: initscript puppet, action "stop" failed.
dpkg: error processing puppet (--remove):
subprocess pre-removal script returned error exit status 1
invoke-rc.d: initscript puppet, action "start" failed.
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
# cat /var/lib/dpkg/info/puppet.prerm
# Automatically added by dh_installinit
if [ -x "/etc/init.d/puppet" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d puppet stop || exit $?
/etc/init.d/puppet stop || exit $?
# End automatically added section
Puppet is not running, put the package fails to remove since the prerm
script has failed. I changed the exit $? to exit 0, and I can remove the
package without starting puppet.