【问题标题】:MongoDB installation problems Linux Mint DebianMongoDB 安装问题 Linux Mint Debian
【发布时间】:2014-12-09 18:35:18
【问题描述】:

由于一些 Dpkg 错误,MongoDB 没有正确安装。试图清除或删除 任何相关的东西都伴随着错误。我尝试删除所有 Mongodb 库并搜索其他文件。我不确定是什么导致了原始错误或如何使系统恢复到可工作状态:

Setting up mongodb-org-server (2.6.5) ...
invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

这是原来的安装命令

$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 115 MB of archives.
After this operation, 290 MB of additional disk space will be used.
Get:1 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen mongodb-org-               shell amd64 2.6.5 [4,458 kB]
Get:2 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen mongodb-org-    server amd64 2.6.5 [9,446 kB]                                                                                   
Get:3 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen mongodb-org-    mongos amd64 2.6.5 [7,175 kB]                                                                                   
Get:4 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen mongodb-org-    tools amd64 2.6.5 [93.7 MB]                                                                                     
Get:5 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen mongodb-org amd64 2.6.5 [3,656 B]                                                                                           
Fetched 115 MB in 4min 20s (441 kB/s)                                                                                                                                                                 
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 165525 files and directories currently installed.)
Unpacking mongodb-org-shell (from .../mongodb-org-shell_2.6.5_amd64.deb) ...
Selecting previously unselected package mongodb-org-server.
Unpacking mongodb-org-server (from .../mongodb-org-server_2.6.5_amd64.deb) ...
Selecting previously unselected package mongodb-org-mongos.
Unpacking mongodb-org-mongos (from .../mongodb-org-mongos_2.6.5_amd64.deb) ...
Selecting previously unselected package mongodb-org-tools.
Unpacking mongodb-org-tools (from .../mongodb-org-tools_2.6.5_amd64.deb) ...
Selecting previously unselected package mongodb-org.
Unpacking mongodb-org (from .../mongodb-org_2.6.5_amd64.deb) ...
Processing triggers for man-db ...
Setting up mongodb-org-shell (2.6.5) ...
Setting up mongodb-org-server (2.6.5) ...
Adding system user `mongodb' (UID 120) ...
Adding new user `mongodb' (UID 120) with group `nogroup' ...
Not creating home directory `/home/mongodb'.
Adding group `mongodb' (GID 126) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 100
Setting up mongodb-org-mongos (2.6.5) ...
Setting up mongodb-org-tools (2.6.5) ...
dpkg: dependency problems prevent configuration of mongodb-org:
mongodb-org depends on mongodb-org-server; however:
Package mongodb-org-server is not configured yet.

dpkg: error processing mongodb-org (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mongodb-org-server
 mongodb-org
E: Sub-process /usr/bin/dpkg returned an error code (1)

【问题讨论】:

    标签: installation debian-based


    【解决方案1】:

    尝试使用这个初始化脚本。 init.d

    如果您之前安装了 MongoDB,请先将其卸载。

    删除МongoDB。 sudo apt-get remove mongodb-10gen 之后删除配置文件和初始化脚本 sudo find /etc/ | grep mongod.* | xargs rm -rf sudo find /usr/bin/ | grep mongod.* | xargs rm -rf sudo find /var/lib/ | grep mongod.* | xargs rm -rf

    警告! /var/lib/ 可能包含您的数据库。

    Install MongoDB

    【讨论】:

      【解决方案2】:

      有

      apt-get autoremove
      apt-get -f install
      

      值得先尝试,如果它不起作用,实际上我有一半配置的 mongodb-org-server 并且没有常规方法可以删除。 然后我找到了a worst solution which is to remove package status block。但是你会忘记真正的包裹状态,并在你的系统中留下垃圾。 所以我检查了我们收到的错误消息,我发现这行很有趣:

      invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
      

      然后我创建一个空文件来欺骗调用函数。

      touch /etc/init.d/mongod
      

      然后再次尝试 apt-get autoremove 并 apt-get remove 成功!

      【讨论】:

        【解决方案3】:

        运行这段代码

        触摸 /etc/init.d/mongod

        然后点击该链接 https://community.c9.io/t/setting-up-mongodb/1717

        注意:(--rest) 在最新版本的 mongo 中被删除。

        【讨论】:

          猜你喜欢
          • 2014-03-03
          • 2020-05-31
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-08-28
          • 2021-07-13
          • 2017-06-21
          • 2019-03-06
          相关资源
          最近更新 更多