MongoDB install errors / E: Sub-process /usr/bin/dpkg returned an error code (1)

390

Solution 1

This AskUbuntu post solved the problem for me; I edited /var/lib/dpkg/status and removed the section that was causing problems.

Solution 2

Since the error message complains about /etc/init.d/mongodb not existing, try creating that file. This is probably enough to make progress in this case.

In general, when an installation or removal script fails, look at /var/lib/dpkg/info/$PACKAGE.{preinst,postinst,prerm,postrm}. If it's a shell script, add set -x just below the #! line to make it print a trace. Edit the script if necessary to correct the error, then run apt-get -f install.

Share:
390

Related videos on Youtube

djm
Author by

djm

Updated on September 18, 2022

Comments

  • djm
    djm over 1 year

    Long story short, I lost my contacts from an old e-mail but I have their e-mail/details in the body of invoices that I forwarded to my current address. I've been copying thousands of e-mail out out by hand, but am realizing I'll have carpal tunnel before it's done. Is there a way to do this short of hiring someone to write a script? Tried forwarding e-mail to Thunderbird, but the extension that looked like it might do this doesn't search the body of e-mail https://addons.mozilla.org/en-us/thunderbird/addon/email-address-crawler/

    Also, looking into autohotkey, but am under time constraints. Grateful for any pointers here!

    • schaiba
      schaiba over 10 years
      Try apt-get install -f .
    • cometbill
      cometbill over 10 years
      Thanks @schaiba, that also didn't work - Updated text of question to include this.
  • Ludwig Schulze
    Ludwig Schulze about 9 years
    This is just the worst possible solution.
  • cometbill
    cometbill about 9 years
    @Braiam You can't just say "this is bad" and then not offer any alternative, or reason as to why it is bad.
  • Ludwig Schulze
    Ludwig Schulze about 9 years
    If you see my comment on the other answer that you followed, you will notice why.