It seems that after upgrading to Ubuntu/ Kubuntu 18.04 has broken my MongoDB server.
I have tried to reinstall Mongo but I still can't start it as before:
$ sudo apt-get install mongodb-server
$ mongo --version
MongoDB shell version v3.6.3
git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
OpenSSL version: OpenSSL 1.1.0h 27 Mar 2018
allocator: tcmalloc
modules: none
build environment:
distarch: x86_64
target_arch: x86_64
The status:
$ sudo service mongodb status
● mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2018-10-07 14:30:40 BST; 17s ago
Docs: man:mongod(1)
Process: 5925 ExecStart=/usr/bin/mongod --unixSocketPrefix=${SOCKETPATH} --config ${CONF} $DAEMON_OPTS (code=exited, status=62)
Main PID: 5925 (code=exited, status=62)
Oct 07 14:30:38 lau-desktop systemd[1]: Started An object/document-oriented database.
Oct 07 14:30:40 lau-desktop systemd[1]: mongodb.service: Main process exited, code=exited, status=62/n/a
Oct 07 14:30:40 lau-desktop systemd[1]: mongodb.service: Failed with result 'exit-code'.
Any ideas?
EDIT:
When I tried to install mongo 4, I get the error:
Preparing to unpack .../mongodb-org-server_4.0.3_amd64.deb ...
Unpacking mongodb-org-server (4.0.3) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.0.3_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_4.0.3_amd64.deb ...
Unpacking mongodb-org-mongos (4.0.3) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.0.3_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-tools_4.0.3_amd64.deb ...
Unpacking mongodb-org-tools (4.0.3) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-tools_4.0.3_amd64.deb (--unpack):
trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-server_4.0.3_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.0.3_amd64.deb
/var/cache/apt/archives/mongodb-org-tools_4.0.3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
EDIT 2:
$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
mongodb-org : Depends: mongodb-org-server but it is not installed
Depends: mongodb-org-mongos but it is not installed
Depends: mongodb-org-tools but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
EDIT 3:
$ mongo --versionMongoDB shell version v4.0.3
git version: 7ea530946fa7880364d88c8d8b6026bbc9ffa48c
OpenSSL version: OpenSSL 1.1.0h 27 Mar 2018
allocator: tcmalloc
modules: none
build environment:
distmod: ubuntu1804
distarch: x86_64
target_arch: x86_64
$ sudo service mongodb status
● mongodb.service
Loaded: masked (/dev/null; bad)
Active: failed (Result: exit-code) since Sun 2018-10-07 15:12:14 BST; 1h 7min ago
Main PID: 2232 (code=exited, status=62)
Oct 07 15:12:13 lau-desktop systemd[1]: Started An object/document-oriented database.
Oct 07 15:12:14 lau-desktop systemd[1]: mongodb.service: Main process exited, code=exited, status=62/n/a
Oct 07 15:12:14 lau-desktop systemd[1]: mongodb.service: Failed with result 'exit-code'.
sudo apt clean
to clean the cache folder then try the install again. – Terrance Oct 07 '18 at 14:30sudo apt update
andsudo apt upgrade
and maybe see if it upgrades to the 4.0 which is supposed to be for Ubuntu 18.04. – Terrance Oct 07 '18 at 14:52