dpkg:在Ubuntu 18.04上安装mongodb时出错

dpkg:在Ubuntu 18.04上安装mongodb时出错

我正在尝试在 Ubuntu 18.04 中安装最新版本的 mongodb。运行命令时sudo apt install -y mongodb出现以下错误。我想我的问题类似于https://serverfault.com/questions/809925/dpkg-error-processing-package如何调试子进程安装后中的 dpkg configure 错误?。但是,由于我是 Ubuntu 新手,因此我不明白该解决方案。解决此问题的步骤是什么?

错误

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: failed (Result: exit-code) since Thu 2019-03-21 17:09:18 +0530; 26min ago
 Main PID: 14453 (code=exited, status=1/FAILURE)

Mar 21 17:20:59 kabilesh-Latitude-E6540 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Mar 21 17:21:10 kabilesh-Latitude-E6540 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Mar 21 17:21:11 kabilesh-Latitude-E6540 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Mar 21 17:21:22 kabilesh-Latitude-E6540 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Mar 21 17:21:23 kabilesh-Latitude-E6540 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Mar 21 17:29:57 kabilesh-Latitude-E6540 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Mar 21 17:35:27 kabilesh-Latitude-E6540 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Mar 21 17:35:43 kabilesh-Latitude-E6540 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Mar 21 17:35:46 kabilesh-Latitude-E6540 systemd[1]: mongodb.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Mar 21 17:35:47 kabilesh-Latitude-E6540 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
Processing triggers for libc-bin (2.27-3ubuntu1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          Processing triggers for systemd (237-3ubuntu10.13) ...
Processing triggers for ureadahead (0.100.0-20) ...
Errors were encountered while processing:
 mongodb-server
 mongodb
E: Sub-process /usr/bin/dpkg returned an error code (1)

查找 /etc-名称”蒙哥

/etc/rc0.d/K01mongodb
/etc/rc2.d/S01mongodb
/etc/init/mongod.conf
/etc/mongodb.conf
/etc/mongod.conf
/etc/apt/sources.list.d/mongodb-org-4.0.list.save
/etc/apt/sources.list.d/mongodb-org-3.6.list.save
/etc/apt/sources.list.d/mongodb-org-3.6.list
/etc/apt/sources.list.d/mongodb-org-4.0.list
/etc/logrotate.d/mongodb-server
find: ‘/etc/ssl/private’: Permission denied
/etc/rc4.d/S01mongodb
/etc/systemd/system/mongodb.service
/etc/rc3.d/S01mongodb
/etc/rc1.d/K01mongodb
/etc/rc5.d/S01mongodb
find: ‘/etc/polkit-1/localauthority’: Permission denied
/etc/init.d/mongodb
find: ‘/etc/cups/ssl’: Permission denied
/etc/rc6.d/K01mongodb

答案1

尝试删除该 mongodb

sudo apt-get purge mongodb

然后尝试像这样安装:

sudo apt-get install mongodb-org

相关内容