<span class="postbody">I&#39;m running amd64 Lenny with only the standard repos.
<br>
I got this error when trying to remove the nagios3 package:
<br>
</span><table align="center" width="90%" border="0" cellpadding="3" cellspacing="1"><tbody><tr>           <td><span class="genmed"><b></b></span></td>        </tr>        <tr>          <td class="code">/var/lib/dpkg/info/nagios3-common.prerm: line 23: syntax error near unexpected token `fi&#39;
<br>
dpkg: error processing nagios3-common (--remove):
<br>
 subprocess pre-removal script returned error exit status 2
<br>
Errors were encountered while processing:
<br>
 nagios3-common
<br>
E: Sub-process /usr/bin/dpkg returned an error code (1)</td>        </tr></tbody></table><span class="postbody">
<br>

<br>
I decided to investigate and found a broken &#39;if&#39; statement in
/var/lib/dpkg/info/nagios3-common.prerm. I fixed the if statement and
it removed properly.</span>