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

e sub process data/data/com termux files/usr/bin/dpkg returned an error code (1)
e sub process returned an error code sudo apt-get update
errors were encountered while processing: mongodb-org-server
failed to start mongod.service: unit mongod.service not found.
mongodb packages
mongodb-org-shell
mongodb client ubuntu
start mongodb linux

I'm trying to install things in Linux (Crunchbang Linux - a derivation of Debian), and I'm getting errors which point towards mongodb-20gen.

When I try to remove it using :-

cometbill@Linuxn00b:~$ sudo apt-get remove mongodb-10gen

I get ...

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  mongodb-10gen
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 221 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 81657 files and directories currently installed.)
Removing mongodb-10gen ...
arg: remove
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error processing mongodb-10gen (--remove):
 subprocess installed pre-removal script returned error exit status 100
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
 mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)

I read something on here for similar errors with MongoDB, and it suggested removing mongo-clients, so, I tried:-

cometbill@Linuxn00b:~$ sudo apt-get remove mongodb-clients

and get:-

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'mongodb-clients' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mongodb-10gen (2.4.6) ...
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error processing mongodb-10gen (--configure):
 subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
 mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)

This is due to some corruption within the package manager dpkg itself, this thread from Ask Ubuntu: https://askubuntu.com/questions/195950/package-system-broken-e-sub-process-usr-bin-dpkg-returned-an-error-code-1 lists some solutions, more specifically the editing of the status file has been noted as one that always works.

MongoDB install errors / E: Sub-process /usr/bin/dpkg returned an , This is due to some corruption within the package manager dpkg itself, this thread -e-sub-process-usr-bin-dpkg-returned-an-error-code-1 lists some solutions,  The error message “Sub-process /usr/bin/dpkg returned an error code (1)” indicates a problem with the package installer. This can happen in Ubuntu after a failed software installation, or if the installer becomes corrupted. The key phrase in this error is /usr/bin/dpkg. This refers to the dpkg package installer for Linux.

This is a difficult state to get out of. You should be able to complete the removal if you create a fake init script:

sudo touch /etc/init.d/mongodb
sudo chmod 755 /etc/init.d/mongodb

dpkg - Cannot uninstall MongoDB, 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  If you are encountering “sub process usr bin dpkg returned an error code 1” while installing software on Ubuntu Linux, here is how you can fix it.

For mongodb v3.4

sudo touch /etc/init.d/mongod
sudo chmod 755 /etc/init.d/mongod

MongoDB failing to install (For UniFi Controller), Try apt-get --reinstall install mongodb. This will pretend that mongodb isn't installed already and overwrite the old files. Afterwards you should  Thank you. It helped me solve the problem as well… In addition, I had to run the update manager again to fix the problem after running sudo dpkg –configure -a on the terminal.

You can force installation of package:

sudo dpkg -i --force-all /var/cache/apt/archives/mongodb-org-tools_3.6.5_amd64.deb

Then resume with:

sudo apt-get install -f

UniFi 3.2.10 fails to install on fresh Ubuntu 14.04.2 LTS, Now when I run apt upgrade I get the following errors: You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: mongodb-org : Depends: mongodb-server (>= 2.4.10) but it is not installed or mongodb-10gen E: Sub-process /usr/bin/dpkg returned an error code (1). Done mongodb-10gen is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used.

sudo nano /var/lib/dpkg/statoverride

Then remove first 2 line entries and try again

**mongodb mongodb 755 /var/log/mongodb
mongodb mongodb 755 /var/lib/mongodb**
root crontab 2755 /usr/bin/crontab
root mlocate 2755 /usr/bin/mlocate
root ssl-cert 710 /etc/ssl/private
root messagebus 4754 /usr/lib/dbus-1.0/dbus-daemon-launch-helper

mongodb, Here's what I did in a new Ubuntu install and what happened in the end: # vim deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen mongodb-10genE: Sub-process /usr/bin/dpkg returned an error code (1). Trying to subprocess installed post-installation script returned error exit status 1 Errors were  Done The following NEW packages will be installed: mongodb-10gen 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/51.9 MB of archives. After this operation, 127 MB of additional disk space will be used.

apt-get error: trying to overwrite '/usr/bin/mongofiles', which is also in , Question The package system is broken; unmet dependencies; mongodb. Dear all, E: Sub-process /usr/bin/dpkg returned an error code (1). The following packages will be REMOVED: mongodb The following NEW packages will be installed: mongodb-10gen 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. Need to get 50.6 MB of archives.

Fix ”sub process usr bin dpkg returned an error code 1" in Ubuntu, I've been trying to install MongoDB on my Ubuntu 10.04 laptop (32bit) for some sudo apt-get install mongodb-10gen Errors were encountered while processing: E: Sub-process /usr/bin/dpkg returned an error code (1) The following NEW packages will be installed: mongodb-10gen 0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded. Need to get 0 B/52.0 MB of archives. After this operation, 126 MB of additional disk space will be used.

MongoDB not installable from 10gen's Debian repository, The error message “Sub-process /usr/bin/dpkg returned an error code (1)” indicates a problem with the package installer. This can happen in Ubuntu after a failed software installation, or if the installer becomes corrupted. The key phrase in this error is /usr/bin/dpkg. I'm trying to reinstall it, because it has problems. For example, I can't install Chromium because mongodb-org-server is not configured. But I can't even remove it for the same reason. apt-get

Comments
  • This is probably something more for ask ubuntu or server fault, I know your not running ubunut but try: askubuntu.com/questions/195950/…
  • @Sammaye add your comment as an answer. I tried it and it seems to have worked.