0

when i try to install mongodb at that time i found below error in command line please help me to install it.

dpkg: error processing package mongodb (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.21-0ubuntu4) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (219-7ubuntu6) ...
Errors were encountered while processing:
 postfix
 mongodb-server
 mongodb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Mofi
  • 46,139
  • 17
  • 80
  • 143
sunil
  • 195
  • 1
  • 3
  • 11

3 Answers3

0

Same problem I got earlier and I resolved it by removing this file

/var/lib/dpkg/info/mongodb-org-server.postinst

And then reinstall.

abdulbarik
  • 6,101
  • 5
  • 38
  • 59
0

It is happening because you have already installed the above package and then removed it.

Here is the trick that worked for me :

sudo apt-get autoremove [package name]

then remove the package file from /var/lib/dpkg/info using command rm -rf. Try to re-install the package.

Anurag Sinha
  • 187
  • 4
  • 15
0

I think you already have it installed but somehow it is not working for you. Please try apt-get --reinstall install mongodb. It will reinstall it again. if it still doesn't work then follow this link and it worked on mine: https://docs.mongodb.com/getting-started/shell/tutorial/install-mongodb-on-ubuntu/