简体   繁体   中英

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.

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. Eg you may install just mongo shell . Take a look at this article .

This was some time back. I have mongo working OK

Un install anything you have NOW ... There is a default Mongo comes with Ubuntu.

Visit the Ubuntu Mongo-shell installation.

The other Install -s appear to depend on the shell install. I find that refreshing actually. I wish real databases( tm ) would pay attention. Things USED- TO work like that. All the time. Wow.

The other useful tidbits are ...

  1. stop
  2. restart
  3. start

And

  1. configuration.
    • file: /etc/mongod.conf
    • see also: /etc/init.d/README file.

A very useful engine ... 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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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