Ubuntu 18.04中的MongoDB安装错误

时间:2018-11-09 18:34:15

标签: mongodb installation ubuntu-18.04

我已经尝试了多次安装,还尝试了将其卸载,而不是再次安装,但没有任何帮助。我要在下面添加错误屏幕截图:

这是当我尝试卸载或删除软件包时发生的情况,并且没有安装,同样的错误再次出现。

-----------------------------------------------------------
root@parita-ThinkPad-L420:/home/parita# sudo apt-get install mongodb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  mongodb
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 9,892 B of archives.
After this operation, 44.0 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 mongodb amd64 1:3.6.3-0ubuntu1 [9,892 B]
Fetched 9,892 B in 1s (10.9 kB/s)  
Selecting previously unselected package mongodb.
(Reading database ... 173540 files and directories currently installed.)
Preparing to unpack .../mongodb_1%3a3.6.3-0ubuntu1_amd64.deb ...
Unpacking mongodb (1:3.6.3-0ubuntu1) ...
Setting up mongodb-server (1:3.6.3-0ubuntu1) ...
Failed to start mongodb.service: Unit mongodb.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status mongodb.service' for details.
invoke-rc.d: initscript mongodb, action "start" failed.
● mongodb.service
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)

Nov 09 23:18:55 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:18:56 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:18:56 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:20:49 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:20:49 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:20:49 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:38:26 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:38:26 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:40:31 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:40:31 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
dpkg: error processing package mongodb-server (--configure):
 installed mongodb-server package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mongodb:
 mongodb depends on mongodb-server (>= 1:2.4.1-2); however:
  Package mongodb-server is not configured yet.

dpkg: error processing package mongodb (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 mongodb-server
 mongodb
E: Sub-process /usr/bin/dpkg returned an error code (1)
----------------------------------------------------------------
root@parita-ThinkPad-L420:/home/parita# mongo
MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
2018-11-09T23:40:39.048+0530 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-11-09T23:40:39.049+0530 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed
-------------------------------------------------------
root@parita-ThinkPad-L420:/home/parita# sudo apt-get remove mongodb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  mongodb
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 44.0 kB disk space will be freed.
Do you want to continue? [Y/n] Y    
(Reading database ... 173543 files and directories currently installed.)
Removing mongodb (1:3.6.3-0ubuntu1) ...
Setting up mongodb-server (1:3.6.3-0ubuntu1) ...
Failed to start mongodb.service: Unit mongodb.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status mongodb.service' for details.
invoke-rc.d: initscript mongodb, action "start" failed.
● mongodb.service
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)

Nov 09 23:18:56 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:20:49 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:20:49 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:20:49 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:38:26 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:38:26 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:40:31 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:40:31 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:54:01 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Nov 09 23:54:01 parita-ThinkPad-L420 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
dpkg: error processing package mongodb-server (--configure):
 installed mongodb-server package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 mongodb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@parita-ThinkPad-L420:/home/parita# mongo
MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
2018-11-09T23:55:10.702+0530 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-11-09T23:55:10.702+0530 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed

0 个答案:

没有答案