简体   繁体   English

无法在Linux上安装mongodb

[英]Unable to install mongodb on linux

I am using sudo apt-get install mongodb command but it is giving me error , i think there is problem with packaging but i am unable to find it. 我正在使用sudo apt-get install mongodb命令,但它给了我错误,我认为包装存在问题,但我找不到它。

mongodb start/running, process 15259
Can't exec "/sbin/insserv": No such file or directory at /usr/sbin/update-rc.d line 382.
update-rc.d: error: insserv rejected the script header
No apport report written because the error message indicates its a followup error from a previous failure.
                          dpkg: error processing package mongodb-server (--configure):
 subprocess installed post-installation script returned error exit status 255
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.19-0ubuntu6) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
 postfix
 mongodb-server
 mongodb
E: Sub-process /usr/bin/dpkg returned an error code (1)

With version 3.0 MongoDB has split the package into parts. 在3.0版中,MongoDB将软件包分为几部分。 Eg you may install just mongo shell . 例如,您可以只安装mongo shell Take a look at this article . 看一下这篇文章

This was some time back. 这是一段时间了。 I have mongo working OK 我让mongo工作正常

Un install anything you have NOW ... There is a default Mongo comes with Ubuntu. 卸载您现在拥有的任何东西... Ubuntu附带一个默认的Mongo。

Visit the Ubuntu Mongo-shell installation. 访问Ubuntu Mongo-shell安装。

The other Install -s appear to depend on the shell install. 其他Install -s似乎取决于shell安装。 I find that refreshing actually. 我发现实际上令人耳目一新。 I wish real databases( tm ) would pay attention. 我希望真正的数据库( tm )会引起注意。 Things USED- TO work like that. 事情USED​​- 喜欢这项工作。 All the time. 每时每刻。 Wow. 哇。

The other useful tidbits are ... 其他有用的花絮是...

  1. stop
  2. restart 重新开始
  3. start 开始

And

  1. configuration. 组态。
    • file: /etc/mongod.conf 文件: /etc/mongod.conf
    • see also: /etc/init.d/README file. 另请参阅: /etc/init.d/README文件。

A very useful engine ... w 一个非常有用的引擎... w

You can try this 你可以试试这个

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

sudo apt-get update

sudo apt-get install -y mongodb-org

more details https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/ 更多详细信息https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM