2

Im trying to install mongodbserver on ubuntu 14.04LTS with reference to mongodb docs but getting the dpkg related errors

root@c3:~# apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mongodb-org is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mongodb-org-server (3.0.12) ...
start: Job failed to start
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing package mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 1
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 package 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)

i did below steps so far:

apt-get purge mongodb-org*
apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get update
sherpaurgen
  • 608
  • 3
  • 10
  • 26
  • You need to debug your post-installation script. See this answer here: http://askubuntu.com/questions/422264/how-to-debug-dpkg-configure-error-in-subprocess-post-installation – Spooler Oct 19 '16 at 14:08
  • @Spooler: I think you answered this question :-). I took the liberty of putting that into an answer. – sleske Nov 22 '18 at 12:00

2 Answers2

1

As indicated in Spooler's comment, the important piece of information is this part:

invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing package mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 1

As part of package installation, dpkg will run scripts provided by the package. In this case, the package mongodb-org-server provides a script to be run after installation (called a "post-installation script", which is one of various package maintainer scripts that a package may contain). The problem is that this script indicated a failure when it was run, by returning with an exit code of 1. The other errors are a consequence of this failure.

To solve this, you need to figure out why the post-installation script failed, usually by debugging the script. For more information on how to do this, see e.g. How to debug dpkg configure error in subprocess post-installation? on askubuntu.com.

sleske
  • 9,851
  • 4
  • 33
  • 44
0

It is not configured properly, try to run:

sudo dpkg-reconfigure -a

David B.
  • 466
  • 1
  • 3
  • 12