# dpkg -r nginx dpkg: error processing nginx (--remove): Package is in a very bad inconsistent state - you should reinstall it before attempting a removal. Errors were encountered while processing: nginx # dpkg --install nginx_0.4.13-2_i386.deb Selecting previously deselected package nginx. (Reading database ... 25365 files and directories currently installed.) Preparing to replace nginx 0.4.13-2 (using nginx_0.4.13-2_i386.deb) ... Stopping nginx: invoke-rc.d: initscript nginx, action "stop" failed. dpkg: warning - old pre-removal script returned error exit status 1 dpkg - trying script from the new package instead ... Stopping nginx: invoke-rc.d: initscript nginx, action "stop" failed. dpkg: error processing nginx_0.4.13-2_i386.deb (--install): subprocess new pre-removal script returned error exit status 1 Starting nginx: invoke-rc.d: initscript nginx, action "start" failed. dpkg: error while cleaning up: subprocess post-installation script returned error exit status 1 Errors were encountered while processing: nginx_0.4.13-2_i386.deb