Mongdb uninstall (and install) failures: Already uninstalled or something broken?











up vote
0
down vote

favorite












I tried to install MongoDB, but something went wrong with the installation and I want to install it again. Unfortunately, I get errors when attempting to remove/pruge, and I suspect those errors might be related to my subsequent failures to reinstall.



~$ sudo apt-get purge mongo*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mongodb18-10gen' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-tools' for glob 'mongo*'
Note, selecting 'mongo20-10gen' for glob 'mongo*'
Note, selecting 'mongodb' for glob 'mongo*'
Note, selecting 'mongodb-org-mongos' for glob 'mongo*'
Note, selecting 'mongo18-10gen' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-org-tools' for glob 'mongo*'
Note, selecting 'mongodb-stable' for glob 'mongo*'
Note, selecting 'mongodb-server-core' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-enterprise' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongo-tools' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongodb-nightly' for glob 'mongo*'
Note, selecting 'mongo18-10gen-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongo20-10gen-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable' for glob 'mongo*'
Note, selecting 'mongodb-org-shell' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongodb-dev' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen' for glob 'mongo*'
Note, selecting 'mongodb-10gen-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-server' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-org' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable' for glob 'mongo*'
Note, selecting 'mongodb-clients' for glob 'mongo*'
Note, selecting 'mongo-10gen-server' for glob 'mongo*'
Note, selecting 'mongo-10gen-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-org-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen' for glob 'mongo*'
Note, selecting 'mongodb20-10gen' for glob 'mongo*'
Package 'mongo-10gen' is not installed, so not removed
Package 'mongo-10gen-enterprise' is not installed, so not removed
Package 'mongo-10gen-enterprise-server' is not installed, so not removed
Package 'mongo-10gen-server' is not installed, so not removed
Package 'mongo-10gen-unstable' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-mongos' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-server' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-shell' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-tools' is not installed, so not removed
Package 'mongo-10gen-unstable-mongos' is not installed, so not removed
Package 'mongo-10gen-unstable-server' is not installed, so not removed
Package 'mongo-10gen-unstable-shell' is not installed, so not removed
Package 'mongo-10gen-unstable-tools' is not installed, so not removed
Package 'mongo18-10gen' is not installed, so not removed
Package 'mongo18-10gen-server' is not installed, so not removed
Package 'mongo20-10gen' is not installed, so not removed
Package 'mongo20-10gen-server' is not installed, so not removed
Package 'mongodb-10gen' is not installed, so not removed
Package 'mongodb-10gen-enterprise' is not installed, so not removed
Package 'mongodb-10gen-unstable' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-mongos' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-server' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-shell' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-tools' is not installed, so not removed
Package 'mongodb-10gen-unstable-mongos' is not installed, so not removed
Package 'mongodb-10gen-unstable-server' is not installed, so not removed
Package 'mongodb-10gen-unstable-shell' is not installed, so not removed
Package 'mongodb-10gen-unstable-tools' is not installed, so not removed
Package 'mongodb-enterprise-unstable' is not installed, so not removed
Package 'mongodb-enterprise-unstable-mongos' is not installed, so not removed
Package 'mongodb-enterprise-unstable-server' is not installed, so not removed
Package 'mongodb-enterprise-unstable-shell' is not installed, so not removed
Package 'mongodb-enterprise-unstable-tools' is not installed, so not removed
Package 'mongodb-nightly' is not installed, so not removed
Package 'mongodb-org-mongos' is not installed, so not removed
Package 'mongodb-org-shell' is not installed, so not removed
Package 'mongodb-org-tools' is not installed, so not removed
Package 'mongodb-org-unstable' is not installed, so not removed
Package 'mongodb-org-unstable-mongos' is not installed, so not removed
Package 'mongodb-org-unstable-server' is not installed, so not removed
Package 'mongodb-org-unstable-shell' is not installed, so not removed
Package 'mongodb-org-unstable-tools' is not installed, so not removed
Package 'mongodb-stable' is not installed, so not removed
Package 'mongodb18-10gen' is not installed, so not removed
Package 'mongodb20-10gen' is not installed, so not removed
Package 'mongo-tools' is not installed, so not removed
Package 'mongodb' is not installed, so not removed
Package 'mongodb-clients' is not installed, so not removed
Package 'mongodb-dev' is not installed, so not removed
Package 'mongodb-server' is not installed, so not removed
Package 'mongodb-server-core' is not installed, so not removed
Package 'mongodb-enterprise' is not installed, so not removed
Package 'mongodb-enterprise-mongos' is not installed, so not removed
Package 'mongodb-enterprise-server' is not installed, so not removed
Package 'mongodb-enterprise-shell' is not installed, so not removed
Package 'mongodb-enterprise-tools' is not installed, so not removed
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org* mongodb-org-server*
0 upgraded, 0 newly installed, 2 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


Also tried reinstall:



~$ sudo apt-get --reinstall install mongodb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5
mongo-tools mongodb-clients mongodb-server mongodb-server-core
The following packages will be REMOVED:
mongodb-org-server
The following NEW packages will be installed:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5
mongo-tools mongodb mongodb-clients mongodb-server mongodb-server-core
0 upgraded, 10 newly installed, 1 to remove and 21 not upgraded.
Need to get 53.4 MB of archives.
After this operation, 154 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libboost-program-options1.65.1 amd64 1.65.1+dfsg-0ubuntu5 [137 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libtcmalloc-minimal4 amd64 2.5-2.2ubuntu3 [91.6 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libgoogle-perftools4 amd64 2.5-2.2ubuntu3 [190 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libpcrecpp0v5 amd64 2:8.39-9 [15.3 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libyaml-cpp0.5v5 amd64 0.5.2-4ubuntu1 [150 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongo-tools amd64 3.6.3-0ubuntu1 [12.3 MB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-clients amd64 1:3.6.3-0ubuntu1 [20.2 MB]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-server-core amd64 1:3.6.3-0ubuntu1 [20.3 MB]
Get:9 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-server all 1:3.6.3-0ubuntu1 [12.6 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb amd64 1:3.6.3-0ubuntu1 [9,892 B]
Fetched 53.4 MB in 5s (11.3 MB/s)
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


and autoremove:



$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.


I am confused is it already fully removed and that's why I am getting these errors, or is it failing to remove? If so, then how is dpkg coming up with the number 62.2 Mb to be removed? Would I be better of nuking my entire Ubuntu installation and starting fromm scratch? Is there a good, COMPLETE guide to installing MongoDB on Ubuntu 18.04? Because even to get my previous broken install partly looking, I had to do stuff suggested in threads that was not mentioned in the official install guide.



Edit: to be clear the issue is that I CANNOT apt-get purge mongo, and the service isn't even running.



~$  sudo service mongod stop
[sudo] password for james:
Failed to stop mongod.service: Unit mongod.service not loaded.
~$ sudo apt-get purge mongodb-org*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mongodb-org-unstable-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-server' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable' for glob 'mongodb-org*'
Note, selecting 'mongodb-org' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-server' for glob 'mongodb-org*'
Package 'mongodb-org-mongos' is not installed, so not removed
Package 'mongodb-org-shell' is not installed, so not removed
Package 'mongodb-org-tools' is not installed, so not removed
Package 'mongodb-org-unstable' is not installed, so not removed
Package 'mongodb-org-unstable-mongos' is not installed, so not removed
Package 'mongodb-org-unstable-server' is not installed, so not removed
Package 'mongodb-org-unstable-shell' is not installed, so not removed
Package 'mongodb-org-unstable-tools' is not installed, so not removed
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org* mongodb-org-server*
0 upgraded, 0 newly installed, 2 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


force remove didn't work either:



~$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
~$ sudo apt-get --force-yes remove mongodb-org-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org-server
0 upgraded, 0 newly installed, 1 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
W: --force-yes is deprecated, use one of the options starting with --allow instead.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
~$ sudo dpkg --purge --force-all mongodb-org-server
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--purge):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server









share|improve this question




















  • 1




    Wildcards (*) in apt commands is generally considered unwise. You may get unexpected and catastrophic results. It only takes a moment to find the correct package name.
    – user535733
    Nov 12 at 23:59










  • That makes sense, but my system seems fine. Do you think that could be the cause of this? And should I consider the fact that the official documentation recommends using a wildcard a sign that the official documentation sucks?
    – Thoughtcraft
    Nov 13 at 0:11










  • Your problem seems to be the pre-removal script. Either edit the script so it doesn't fail, or use apt's --force flag so apt continues the uninstall anyway.
    – user535733
    Nov 13 at 0:13










  • force didn't work, guess I'll have to look into editing the script. Or more just install from the Ubuntu repo against the recommendation of the mongo manual. *Wait nope, cant install from ubuntu repo because of whatever is still hanging around from before.
    – Thoughtcraft
    Nov 13 at 0:27

















up vote
0
down vote

favorite












I tried to install MongoDB, but something went wrong with the installation and I want to install it again. Unfortunately, I get errors when attempting to remove/pruge, and I suspect those errors might be related to my subsequent failures to reinstall.



~$ sudo apt-get purge mongo*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mongodb18-10gen' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-tools' for glob 'mongo*'
Note, selecting 'mongo20-10gen' for glob 'mongo*'
Note, selecting 'mongodb' for glob 'mongo*'
Note, selecting 'mongodb-org-mongos' for glob 'mongo*'
Note, selecting 'mongo18-10gen' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-org-tools' for glob 'mongo*'
Note, selecting 'mongodb-stable' for glob 'mongo*'
Note, selecting 'mongodb-server-core' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-enterprise' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongo-tools' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongodb-nightly' for glob 'mongo*'
Note, selecting 'mongo18-10gen-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongo20-10gen-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable' for glob 'mongo*'
Note, selecting 'mongodb-org-shell' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongodb-dev' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen' for glob 'mongo*'
Note, selecting 'mongodb-10gen-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-server' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-org' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable' for glob 'mongo*'
Note, selecting 'mongodb-clients' for glob 'mongo*'
Note, selecting 'mongo-10gen-server' for glob 'mongo*'
Note, selecting 'mongo-10gen-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-org-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen' for glob 'mongo*'
Note, selecting 'mongodb20-10gen' for glob 'mongo*'
Package 'mongo-10gen' is not installed, so not removed
Package 'mongo-10gen-enterprise' is not installed, so not removed
Package 'mongo-10gen-enterprise-server' is not installed, so not removed
Package 'mongo-10gen-server' is not installed, so not removed
Package 'mongo-10gen-unstable' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-mongos' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-server' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-shell' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-tools' is not installed, so not removed
Package 'mongo-10gen-unstable-mongos' is not installed, so not removed
Package 'mongo-10gen-unstable-server' is not installed, so not removed
Package 'mongo-10gen-unstable-shell' is not installed, so not removed
Package 'mongo-10gen-unstable-tools' is not installed, so not removed
Package 'mongo18-10gen' is not installed, so not removed
Package 'mongo18-10gen-server' is not installed, so not removed
Package 'mongo20-10gen' is not installed, so not removed
Package 'mongo20-10gen-server' is not installed, so not removed
Package 'mongodb-10gen' is not installed, so not removed
Package 'mongodb-10gen-enterprise' is not installed, so not removed
Package 'mongodb-10gen-unstable' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-mongos' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-server' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-shell' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-tools' is not installed, so not removed
Package 'mongodb-10gen-unstable-mongos' is not installed, so not removed
Package 'mongodb-10gen-unstable-server' is not installed, so not removed
Package 'mongodb-10gen-unstable-shell' is not installed, so not removed
Package 'mongodb-10gen-unstable-tools' is not installed, so not removed
Package 'mongodb-enterprise-unstable' is not installed, so not removed
Package 'mongodb-enterprise-unstable-mongos' is not installed, so not removed
Package 'mongodb-enterprise-unstable-server' is not installed, so not removed
Package 'mongodb-enterprise-unstable-shell' is not installed, so not removed
Package 'mongodb-enterprise-unstable-tools' is not installed, so not removed
Package 'mongodb-nightly' is not installed, so not removed
Package 'mongodb-org-mongos' is not installed, so not removed
Package 'mongodb-org-shell' is not installed, so not removed
Package 'mongodb-org-tools' is not installed, so not removed
Package 'mongodb-org-unstable' is not installed, so not removed
Package 'mongodb-org-unstable-mongos' is not installed, so not removed
Package 'mongodb-org-unstable-server' is not installed, so not removed
Package 'mongodb-org-unstable-shell' is not installed, so not removed
Package 'mongodb-org-unstable-tools' is not installed, so not removed
Package 'mongodb-stable' is not installed, so not removed
Package 'mongodb18-10gen' is not installed, so not removed
Package 'mongodb20-10gen' is not installed, so not removed
Package 'mongo-tools' is not installed, so not removed
Package 'mongodb' is not installed, so not removed
Package 'mongodb-clients' is not installed, so not removed
Package 'mongodb-dev' is not installed, so not removed
Package 'mongodb-server' is not installed, so not removed
Package 'mongodb-server-core' is not installed, so not removed
Package 'mongodb-enterprise' is not installed, so not removed
Package 'mongodb-enterprise-mongos' is not installed, so not removed
Package 'mongodb-enterprise-server' is not installed, so not removed
Package 'mongodb-enterprise-shell' is not installed, so not removed
Package 'mongodb-enterprise-tools' is not installed, so not removed
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org* mongodb-org-server*
0 upgraded, 0 newly installed, 2 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


Also tried reinstall:



~$ sudo apt-get --reinstall install mongodb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5
mongo-tools mongodb-clients mongodb-server mongodb-server-core
The following packages will be REMOVED:
mongodb-org-server
The following NEW packages will be installed:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5
mongo-tools mongodb mongodb-clients mongodb-server mongodb-server-core
0 upgraded, 10 newly installed, 1 to remove and 21 not upgraded.
Need to get 53.4 MB of archives.
After this operation, 154 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libboost-program-options1.65.1 amd64 1.65.1+dfsg-0ubuntu5 [137 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libtcmalloc-minimal4 amd64 2.5-2.2ubuntu3 [91.6 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libgoogle-perftools4 amd64 2.5-2.2ubuntu3 [190 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libpcrecpp0v5 amd64 2:8.39-9 [15.3 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libyaml-cpp0.5v5 amd64 0.5.2-4ubuntu1 [150 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongo-tools amd64 3.6.3-0ubuntu1 [12.3 MB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-clients amd64 1:3.6.3-0ubuntu1 [20.2 MB]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-server-core amd64 1:3.6.3-0ubuntu1 [20.3 MB]
Get:9 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-server all 1:3.6.3-0ubuntu1 [12.6 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb amd64 1:3.6.3-0ubuntu1 [9,892 B]
Fetched 53.4 MB in 5s (11.3 MB/s)
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


and autoremove:



$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.


I am confused is it already fully removed and that's why I am getting these errors, or is it failing to remove? If so, then how is dpkg coming up with the number 62.2 Mb to be removed? Would I be better of nuking my entire Ubuntu installation and starting fromm scratch? Is there a good, COMPLETE guide to installing MongoDB on Ubuntu 18.04? Because even to get my previous broken install partly looking, I had to do stuff suggested in threads that was not mentioned in the official install guide.



Edit: to be clear the issue is that I CANNOT apt-get purge mongo, and the service isn't even running.



~$  sudo service mongod stop
[sudo] password for james:
Failed to stop mongod.service: Unit mongod.service not loaded.
~$ sudo apt-get purge mongodb-org*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mongodb-org-unstable-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-server' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable' for glob 'mongodb-org*'
Note, selecting 'mongodb-org' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-server' for glob 'mongodb-org*'
Package 'mongodb-org-mongos' is not installed, so not removed
Package 'mongodb-org-shell' is not installed, so not removed
Package 'mongodb-org-tools' is not installed, so not removed
Package 'mongodb-org-unstable' is not installed, so not removed
Package 'mongodb-org-unstable-mongos' is not installed, so not removed
Package 'mongodb-org-unstable-server' is not installed, so not removed
Package 'mongodb-org-unstable-shell' is not installed, so not removed
Package 'mongodb-org-unstable-tools' is not installed, so not removed
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org* mongodb-org-server*
0 upgraded, 0 newly installed, 2 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


force remove didn't work either:



~$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
~$ sudo apt-get --force-yes remove mongodb-org-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org-server
0 upgraded, 0 newly installed, 1 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
W: --force-yes is deprecated, use one of the options starting with --allow instead.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
~$ sudo dpkg --purge --force-all mongodb-org-server
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--purge):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server









share|improve this question




















  • 1




    Wildcards (*) in apt commands is generally considered unwise. You may get unexpected and catastrophic results. It only takes a moment to find the correct package name.
    – user535733
    Nov 12 at 23:59










  • That makes sense, but my system seems fine. Do you think that could be the cause of this? And should I consider the fact that the official documentation recommends using a wildcard a sign that the official documentation sucks?
    – Thoughtcraft
    Nov 13 at 0:11










  • Your problem seems to be the pre-removal script. Either edit the script so it doesn't fail, or use apt's --force flag so apt continues the uninstall anyway.
    – user535733
    Nov 13 at 0:13










  • force didn't work, guess I'll have to look into editing the script. Or more just install from the Ubuntu repo against the recommendation of the mongo manual. *Wait nope, cant install from ubuntu repo because of whatever is still hanging around from before.
    – Thoughtcraft
    Nov 13 at 0:27















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I tried to install MongoDB, but something went wrong with the installation and I want to install it again. Unfortunately, I get errors when attempting to remove/pruge, and I suspect those errors might be related to my subsequent failures to reinstall.



~$ sudo apt-get purge mongo*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mongodb18-10gen' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-tools' for glob 'mongo*'
Note, selecting 'mongo20-10gen' for glob 'mongo*'
Note, selecting 'mongodb' for glob 'mongo*'
Note, selecting 'mongodb-org-mongos' for glob 'mongo*'
Note, selecting 'mongo18-10gen' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-org-tools' for glob 'mongo*'
Note, selecting 'mongodb-stable' for glob 'mongo*'
Note, selecting 'mongodb-server-core' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-enterprise' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongo-tools' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongodb-nightly' for glob 'mongo*'
Note, selecting 'mongo18-10gen-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongo20-10gen-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable' for glob 'mongo*'
Note, selecting 'mongodb-org-shell' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongodb-dev' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen' for glob 'mongo*'
Note, selecting 'mongodb-10gen-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-server' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-org' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable' for glob 'mongo*'
Note, selecting 'mongodb-clients' for glob 'mongo*'
Note, selecting 'mongo-10gen-server' for glob 'mongo*'
Note, selecting 'mongo-10gen-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-org-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen' for glob 'mongo*'
Note, selecting 'mongodb20-10gen' for glob 'mongo*'
Package 'mongo-10gen' is not installed, so not removed
Package 'mongo-10gen-enterprise' is not installed, so not removed
Package 'mongo-10gen-enterprise-server' is not installed, so not removed
Package 'mongo-10gen-server' is not installed, so not removed
Package 'mongo-10gen-unstable' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-mongos' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-server' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-shell' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-tools' is not installed, so not removed
Package 'mongo-10gen-unstable-mongos' is not installed, so not removed
Package 'mongo-10gen-unstable-server' is not installed, so not removed
Package 'mongo-10gen-unstable-shell' is not installed, so not removed
Package 'mongo-10gen-unstable-tools' is not installed, so not removed
Package 'mongo18-10gen' is not installed, so not removed
Package 'mongo18-10gen-server' is not installed, so not removed
Package 'mongo20-10gen' is not installed, so not removed
Package 'mongo20-10gen-server' is not installed, so not removed
Package 'mongodb-10gen' is not installed, so not removed
Package 'mongodb-10gen-enterprise' is not installed, so not removed
Package 'mongodb-10gen-unstable' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-mongos' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-server' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-shell' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-tools' is not installed, so not removed
Package 'mongodb-10gen-unstable-mongos' is not installed, so not removed
Package 'mongodb-10gen-unstable-server' is not installed, so not removed
Package 'mongodb-10gen-unstable-shell' is not installed, so not removed
Package 'mongodb-10gen-unstable-tools' is not installed, so not removed
Package 'mongodb-enterprise-unstable' is not installed, so not removed
Package 'mongodb-enterprise-unstable-mongos' is not installed, so not removed
Package 'mongodb-enterprise-unstable-server' is not installed, so not removed
Package 'mongodb-enterprise-unstable-shell' is not installed, so not removed
Package 'mongodb-enterprise-unstable-tools' is not installed, so not removed
Package 'mongodb-nightly' is not installed, so not removed
Package 'mongodb-org-mongos' is not installed, so not removed
Package 'mongodb-org-shell' is not installed, so not removed
Package 'mongodb-org-tools' is not installed, so not removed
Package 'mongodb-org-unstable' is not installed, so not removed
Package 'mongodb-org-unstable-mongos' is not installed, so not removed
Package 'mongodb-org-unstable-server' is not installed, so not removed
Package 'mongodb-org-unstable-shell' is not installed, so not removed
Package 'mongodb-org-unstable-tools' is not installed, so not removed
Package 'mongodb-stable' is not installed, so not removed
Package 'mongodb18-10gen' is not installed, so not removed
Package 'mongodb20-10gen' is not installed, so not removed
Package 'mongo-tools' is not installed, so not removed
Package 'mongodb' is not installed, so not removed
Package 'mongodb-clients' is not installed, so not removed
Package 'mongodb-dev' is not installed, so not removed
Package 'mongodb-server' is not installed, so not removed
Package 'mongodb-server-core' is not installed, so not removed
Package 'mongodb-enterprise' is not installed, so not removed
Package 'mongodb-enterprise-mongos' is not installed, so not removed
Package 'mongodb-enterprise-server' is not installed, so not removed
Package 'mongodb-enterprise-shell' is not installed, so not removed
Package 'mongodb-enterprise-tools' is not installed, so not removed
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org* mongodb-org-server*
0 upgraded, 0 newly installed, 2 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


Also tried reinstall:



~$ sudo apt-get --reinstall install mongodb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5
mongo-tools mongodb-clients mongodb-server mongodb-server-core
The following packages will be REMOVED:
mongodb-org-server
The following NEW packages will be installed:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5
mongo-tools mongodb mongodb-clients mongodb-server mongodb-server-core
0 upgraded, 10 newly installed, 1 to remove and 21 not upgraded.
Need to get 53.4 MB of archives.
After this operation, 154 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libboost-program-options1.65.1 amd64 1.65.1+dfsg-0ubuntu5 [137 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libtcmalloc-minimal4 amd64 2.5-2.2ubuntu3 [91.6 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libgoogle-perftools4 amd64 2.5-2.2ubuntu3 [190 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libpcrecpp0v5 amd64 2:8.39-9 [15.3 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libyaml-cpp0.5v5 amd64 0.5.2-4ubuntu1 [150 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongo-tools amd64 3.6.3-0ubuntu1 [12.3 MB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-clients amd64 1:3.6.3-0ubuntu1 [20.2 MB]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-server-core amd64 1:3.6.3-0ubuntu1 [20.3 MB]
Get:9 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-server all 1:3.6.3-0ubuntu1 [12.6 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb amd64 1:3.6.3-0ubuntu1 [9,892 B]
Fetched 53.4 MB in 5s (11.3 MB/s)
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


and autoremove:



$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.


I am confused is it already fully removed and that's why I am getting these errors, or is it failing to remove? If so, then how is dpkg coming up with the number 62.2 Mb to be removed? Would I be better of nuking my entire Ubuntu installation and starting fromm scratch? Is there a good, COMPLETE guide to installing MongoDB on Ubuntu 18.04? Because even to get my previous broken install partly looking, I had to do stuff suggested in threads that was not mentioned in the official install guide.



Edit: to be clear the issue is that I CANNOT apt-get purge mongo, and the service isn't even running.



~$  sudo service mongod stop
[sudo] password for james:
Failed to stop mongod.service: Unit mongod.service not loaded.
~$ sudo apt-get purge mongodb-org*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mongodb-org-unstable-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-server' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable' for glob 'mongodb-org*'
Note, selecting 'mongodb-org' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-server' for glob 'mongodb-org*'
Package 'mongodb-org-mongos' is not installed, so not removed
Package 'mongodb-org-shell' is not installed, so not removed
Package 'mongodb-org-tools' is not installed, so not removed
Package 'mongodb-org-unstable' is not installed, so not removed
Package 'mongodb-org-unstable-mongos' is not installed, so not removed
Package 'mongodb-org-unstable-server' is not installed, so not removed
Package 'mongodb-org-unstable-shell' is not installed, so not removed
Package 'mongodb-org-unstable-tools' is not installed, so not removed
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org* mongodb-org-server*
0 upgraded, 0 newly installed, 2 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


force remove didn't work either:



~$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
~$ sudo apt-get --force-yes remove mongodb-org-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org-server
0 upgraded, 0 newly installed, 1 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
W: --force-yes is deprecated, use one of the options starting with --allow instead.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
~$ sudo dpkg --purge --force-all mongodb-org-server
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--purge):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server









share|improve this question















I tried to install MongoDB, but something went wrong with the installation and I want to install it again. Unfortunately, I get errors when attempting to remove/pruge, and I suspect those errors might be related to my subsequent failures to reinstall.



~$ sudo apt-get purge mongo*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mongodb18-10gen' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-tools' for glob 'mongo*'
Note, selecting 'mongo20-10gen' for glob 'mongo*'
Note, selecting 'mongodb' for glob 'mongo*'
Note, selecting 'mongodb-org-mongos' for glob 'mongo*'
Note, selecting 'mongo18-10gen' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-org-tools' for glob 'mongo*'
Note, selecting 'mongodb-stable' for glob 'mongo*'
Note, selecting 'mongodb-server-core' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-enterprise' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongo-tools' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongodb-nightly' for glob 'mongo*'
Note, selecting 'mongo18-10gen-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongo20-10gen-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable' for glob 'mongo*'
Note, selecting 'mongodb-org-shell' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongodb-dev' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen' for glob 'mongo*'
Note, selecting 'mongodb-10gen-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-server' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise-shell' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-server' for glob 'mongo*'
Note, selecting 'mongodb-org-unstable' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-mongos' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-enterprise' for glob 'mongo*'
Note, selecting 'mongodb-org' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-mongos' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable' for glob 'mongo*'
Note, selecting 'mongodb-clients' for glob 'mongo*'
Note, selecting 'mongo-10gen-server' for glob 'mongo*'
Note, selecting 'mongo-10gen-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-org-server' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise-tools' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-server' for glob 'mongo*'
Note, selecting 'mongodb-enterprise-unstable-tools' for glob 'mongo*'
Note, selecting 'mongodb-10gen-unstable-enterprise' for glob 'mongo*'
Note, selecting 'mongo-10gen-unstable-shell' for glob 'mongo*'
Note, selecting 'mongo-10gen' for glob 'mongo*'
Note, selecting 'mongodb20-10gen' for glob 'mongo*'
Package 'mongo-10gen' is not installed, so not removed
Package 'mongo-10gen-enterprise' is not installed, so not removed
Package 'mongo-10gen-enterprise-server' is not installed, so not removed
Package 'mongo-10gen-server' is not installed, so not removed
Package 'mongo-10gen-unstable' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-mongos' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-server' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-shell' is not installed, so not removed
Package 'mongo-10gen-unstable-enterprise-tools' is not installed, so not removed
Package 'mongo-10gen-unstable-mongos' is not installed, so not removed
Package 'mongo-10gen-unstable-server' is not installed, so not removed
Package 'mongo-10gen-unstable-shell' is not installed, so not removed
Package 'mongo-10gen-unstable-tools' is not installed, so not removed
Package 'mongo18-10gen' is not installed, so not removed
Package 'mongo18-10gen-server' is not installed, so not removed
Package 'mongo20-10gen' is not installed, so not removed
Package 'mongo20-10gen-server' is not installed, so not removed
Package 'mongodb-10gen' is not installed, so not removed
Package 'mongodb-10gen-enterprise' is not installed, so not removed
Package 'mongodb-10gen-unstable' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-mongos' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-server' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-shell' is not installed, so not removed
Package 'mongodb-10gen-unstable-enterprise-tools' is not installed, so not removed
Package 'mongodb-10gen-unstable-mongos' is not installed, so not removed
Package 'mongodb-10gen-unstable-server' is not installed, so not removed
Package 'mongodb-10gen-unstable-shell' is not installed, so not removed
Package 'mongodb-10gen-unstable-tools' is not installed, so not removed
Package 'mongodb-enterprise-unstable' is not installed, so not removed
Package 'mongodb-enterprise-unstable-mongos' is not installed, so not removed
Package 'mongodb-enterprise-unstable-server' is not installed, so not removed
Package 'mongodb-enterprise-unstable-shell' is not installed, so not removed
Package 'mongodb-enterprise-unstable-tools' is not installed, so not removed
Package 'mongodb-nightly' is not installed, so not removed
Package 'mongodb-org-mongos' is not installed, so not removed
Package 'mongodb-org-shell' is not installed, so not removed
Package 'mongodb-org-tools' is not installed, so not removed
Package 'mongodb-org-unstable' is not installed, so not removed
Package 'mongodb-org-unstable-mongos' is not installed, so not removed
Package 'mongodb-org-unstable-server' is not installed, so not removed
Package 'mongodb-org-unstable-shell' is not installed, so not removed
Package 'mongodb-org-unstable-tools' is not installed, so not removed
Package 'mongodb-stable' is not installed, so not removed
Package 'mongodb18-10gen' is not installed, so not removed
Package 'mongodb20-10gen' is not installed, so not removed
Package 'mongo-tools' is not installed, so not removed
Package 'mongodb' is not installed, so not removed
Package 'mongodb-clients' is not installed, so not removed
Package 'mongodb-dev' is not installed, so not removed
Package 'mongodb-server' is not installed, so not removed
Package 'mongodb-server-core' is not installed, so not removed
Package 'mongodb-enterprise' is not installed, so not removed
Package 'mongodb-enterprise-mongos' is not installed, so not removed
Package 'mongodb-enterprise-server' is not installed, so not removed
Package 'mongodb-enterprise-shell' is not installed, so not removed
Package 'mongodb-enterprise-tools' is not installed, so not removed
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org* mongodb-org-server*
0 upgraded, 0 newly installed, 2 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


Also tried reinstall:



~$ sudo apt-get --reinstall install mongodb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5
mongo-tools mongodb-clients mongodb-server mongodb-server-core
The following packages will be REMOVED:
mongodb-org-server
The following NEW packages will be installed:
libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.5v5
mongo-tools mongodb mongodb-clients mongodb-server mongodb-server-core
0 upgraded, 10 newly installed, 1 to remove and 21 not upgraded.
Need to get 53.4 MB of archives.
After this operation, 154 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libboost-program-options1.65.1 amd64 1.65.1+dfsg-0ubuntu5 [137 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libtcmalloc-minimal4 amd64 2.5-2.2ubuntu3 [91.6 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libgoogle-perftools4 amd64 2.5-2.2ubuntu3 [190 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libpcrecpp0v5 amd64 2:8.39-9 [15.3 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libyaml-cpp0.5v5 amd64 0.5.2-4ubuntu1 [150 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongo-tools amd64 3.6.3-0ubuntu1 [12.3 MB]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-clients amd64 1:3.6.3-0ubuntu1 [20.2 MB]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-server-core amd64 1:3.6.3-0ubuntu1 [20.3 MB]
Get:9 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb-server all 1:3.6.3-0ubuntu1 [12.6 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb amd64 1:3.6.3-0ubuntu1 [9,892 B]
Fetched 53.4 MB in 5s (11.3 MB/s)
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


and autoremove:



$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.


I am confused is it already fully removed and that's why I am getting these errors, or is it failing to remove? If so, then how is dpkg coming up with the number 62.2 Mb to be removed? Would I be better of nuking my entire Ubuntu installation and starting fromm scratch? Is there a good, COMPLETE guide to installing MongoDB on Ubuntu 18.04? Because even to get my previous broken install partly looking, I had to do stuff suggested in threads that was not mentioned in the official install guide.



Edit: to be clear the issue is that I CANNOT apt-get purge mongo, and the service isn't even running.



~$  sudo service mongod stop
[sudo] password for james:
Failed to stop mongod.service: Unit mongod.service not loaded.
~$ sudo apt-get purge mongodb-org*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mongodb-org-unstable-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-tools' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-server' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-shell' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable-mongos' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-unstable' for glob 'mongodb-org*'
Note, selecting 'mongodb-org' for glob 'mongodb-org*'
Note, selecting 'mongodb-org-server' for glob 'mongodb-org*'
Package 'mongodb-org-mongos' is not installed, so not removed
Package 'mongodb-org-shell' is not installed, so not removed
Package 'mongodb-org-tools' is not installed, so not removed
Package 'mongodb-org-unstable' is not installed, so not removed
Package 'mongodb-org-unstable-mongos' is not installed, so not removed
Package 'mongodb-org-unstable-server' is not installed, so not removed
Package 'mongodb-org-unstable-shell' is not installed, so not removed
Package 'mongodb-org-unstable-tools' is not installed, so not removed
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org* mongodb-org-server*
0 upgraded, 0 newly installed, 2 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


force remove didn't work either:



~$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
~$ sudo apt-get --force-yes remove mongodb-org-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libcurl3
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
mongodb-org-server
0 upgraded, 0 newly installed, 1 to remove and 21 not upgraded.
After this operation, 62.2 MB disk space will be freed.
W: --force-yes is deprecated, use one of the options starting with --allow instead.
Do you want to continue? [Y/n] y
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--remove):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
~$ sudo dpkg --purge --force-all mongodb-org-server
(Reading database ... 187143 files and directories currently installed.)
Removing mongodb-org-server (4.0.4) ...
Failed to stop mongod.service: Unit mongod.service not loaded.
invoke-rc.d: initscript mongod, action "stop" failed.
dpkg: error processing package mongodb-org-server (--purge):
installed mongodb-org-server package pre-removal script subprocess returned error exit status 5
Errors were encountered while processing:
mongodb-org-server






package-management software-installation dependencies uninstall mongodb






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 at 0:25

























asked Nov 12 at 20:09









Thoughtcraft

1012




1012








  • 1




    Wildcards (*) in apt commands is generally considered unwise. You may get unexpected and catastrophic results. It only takes a moment to find the correct package name.
    – user535733
    Nov 12 at 23:59










  • That makes sense, but my system seems fine. Do you think that could be the cause of this? And should I consider the fact that the official documentation recommends using a wildcard a sign that the official documentation sucks?
    – Thoughtcraft
    Nov 13 at 0:11










  • Your problem seems to be the pre-removal script. Either edit the script so it doesn't fail, or use apt's --force flag so apt continues the uninstall anyway.
    – user535733
    Nov 13 at 0:13










  • force didn't work, guess I'll have to look into editing the script. Or more just install from the Ubuntu repo against the recommendation of the mongo manual. *Wait nope, cant install from ubuntu repo because of whatever is still hanging around from before.
    – Thoughtcraft
    Nov 13 at 0:27
















  • 1




    Wildcards (*) in apt commands is generally considered unwise. You may get unexpected and catastrophic results. It only takes a moment to find the correct package name.
    – user535733
    Nov 12 at 23:59










  • That makes sense, but my system seems fine. Do you think that could be the cause of this? And should I consider the fact that the official documentation recommends using a wildcard a sign that the official documentation sucks?
    – Thoughtcraft
    Nov 13 at 0:11










  • Your problem seems to be the pre-removal script. Either edit the script so it doesn't fail, or use apt's --force flag so apt continues the uninstall anyway.
    – user535733
    Nov 13 at 0:13










  • force didn't work, guess I'll have to look into editing the script. Or more just install from the Ubuntu repo against the recommendation of the mongo manual. *Wait nope, cant install from ubuntu repo because of whatever is still hanging around from before.
    – Thoughtcraft
    Nov 13 at 0:27










1




1




Wildcards (*) in apt commands is generally considered unwise. You may get unexpected and catastrophic results. It only takes a moment to find the correct package name.
– user535733
Nov 12 at 23:59




Wildcards (*) in apt commands is generally considered unwise. You may get unexpected and catastrophic results. It only takes a moment to find the correct package name.
– user535733
Nov 12 at 23:59












That makes sense, but my system seems fine. Do you think that could be the cause of this? And should I consider the fact that the official documentation recommends using a wildcard a sign that the official documentation sucks?
– Thoughtcraft
Nov 13 at 0:11




That makes sense, but my system seems fine. Do you think that could be the cause of this? And should I consider the fact that the official documentation recommends using a wildcard a sign that the official documentation sucks?
– Thoughtcraft
Nov 13 at 0:11












Your problem seems to be the pre-removal script. Either edit the script so it doesn't fail, or use apt's --force flag so apt continues the uninstall anyway.
– user535733
Nov 13 at 0:13




Your problem seems to be the pre-removal script. Either edit the script so it doesn't fail, or use apt's --force flag so apt continues the uninstall anyway.
– user535733
Nov 13 at 0:13












force didn't work, guess I'll have to look into editing the script. Or more just install from the Ubuntu repo against the recommendation of the mongo manual. *Wait nope, cant install from ubuntu repo because of whatever is still hanging around from before.
– Thoughtcraft
Nov 13 at 0:27






force didn't work, guess I'll have to look into editing the script. Or more just install from the Ubuntu repo against the recommendation of the mongo manual. *Wait nope, cant install from ubuntu repo because of whatever is still hanging around from before.
– Thoughtcraft
Nov 13 at 0:27












1 Answer
1






active

oldest

votes

















up vote
0
down vote













It turns out that there were some mongdb related files hanging around in /var/lib/dpkg/info that, once deleted, allowed purge to complete successfully.
I am pretty mad at the mongoDB documentation for advising that their package was better maintained than the OS repositories and that I should install from their repository.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1092322%2fmongdb-uninstall-and-install-failures-already-uninstalled-or-something-broken%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    It turns out that there were some mongdb related files hanging around in /var/lib/dpkg/info that, once deleted, allowed purge to complete successfully.
    I am pretty mad at the mongoDB documentation for advising that their package was better maintained than the OS repositories and that I should install from their repository.






    share|improve this answer

























      up vote
      0
      down vote













      It turns out that there were some mongdb related files hanging around in /var/lib/dpkg/info that, once deleted, allowed purge to complete successfully.
      I am pretty mad at the mongoDB documentation for advising that their package was better maintained than the OS repositories and that I should install from their repository.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        It turns out that there were some mongdb related files hanging around in /var/lib/dpkg/info that, once deleted, allowed purge to complete successfully.
        I am pretty mad at the mongoDB documentation for advising that their package was better maintained than the OS repositories and that I should install from their repository.






        share|improve this answer












        It turns out that there were some mongdb related files hanging around in /var/lib/dpkg/info that, once deleted, allowed purge to complete successfully.
        I am pretty mad at the mongoDB documentation for advising that their package was better maintained than the OS repositories and that I should install from their repository.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        Thoughtcraft

        1012




        1012






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1092322%2fmongdb-uninstall-and-install-failures-already-uninstalled-or-something-broken%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?