I use Ubuntu 20.04 and my computer was running MongoDB normally
Suddenly, I become unable to run MongoDB by using systemctl
or service
command despite not chaning anything related to MongoDB
$ systemctl status mongod
Unit mongod.service could not be found.
The same thing also happens if I replace mongod
with mongodb
on the above
However, I can run the mongod --version
$ mongod --version
db version v3.6.8
Another problem is the mongo
command (client)
As suggested, I tried to run sudo apt install mongodb-clients
But I got this error:
dpkg: error processing archive /var/cache/apt/archives/mongo-tools_3.6.3-0ubuntu1_amd64.deb (--unpack):
trying to overwrite '/usr/bin/bsondump', which is also in package mongodb-database-tools 100.7.2
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package mongodb-clients.
Preparing to unpack .../mongodb-clients_1%3a3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3_amd64.deb ...
Unpacking mongodb-clients (1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3) ...
Errors were encountered while processing:
/var/cache/apt/archives/mongo-tools_3.6.3-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
My questions are:
- What should I do so that I can start MongoDB with systemctl
- How to fix the installation of the MongoDB client
I've tried to purge and re-install Mongodb, but still get the same error. I probably messed up the Mongdb version while trying to fix the problems, so you can also suggest me how to remove everything related to Mongodb (including the installation, repository key, etc.), so that I can have a clean and working installation. (I'm still able to run mongod
command after apt purge mongo* which is quite weird)
Or is there anything that I need to do to verify that my 'systemctl' works fine?
Please suggest me how to fix it. I just need to have MongoDB run on my computer (preferably version 3.x or 4.x). I don't want to re-install my computer