Problem
I am trying to get rid of mongodb-org-server once and for all, but this is rather challenging. No matter what I do, I always end up with the same errors:
(Reading database ... 74764 files and directories currently installed.)
Removing mongodb-org-server (3.4.1) ...
invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing package mongodb-org-server (--remove):
subprocess installed pre-removal script returned error exit status 100
invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 100
Removing libc-ares2:amd64 (1.10.0-2ubuntu0.1) ...
Removing libv8-3.14.5 (3.14.5.8-5ubuntu2) ...
Removing mongodb-org-mongos (3.4.1) ...
Removing mongodb-org-shell (3.4.1) ...
Removing mongodb-org-tools (3.4.1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Research
To solve this, I tried following another solution:
but to no avail.
Questions
Any solutions? At this point I am considering a complete format ....
Try to find file
var/lib/dpkg/info/mongodb-org-server.prerm
and comment/remove a lineinvoke-rc.d mongod stop || exit $?
where stop command is placed. Then try to get rid of mongodb-org-server again.