Sub-process /usr/bin/dpkg returned an error code (1) - mongodb

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
cordova-ubuntu-2.8-examples
Use 'apt-get autoremove' to remove it.
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/87.1 MB of archives.
After this operation, 221 MB of additional disk space will be used.
(Reading database ... 250020 files and directories currently installed.)
Unpacking mongodb-10gen (from .../mongodb-10gen_2.4.8_i386.deb) ...
Obsolete conffile /etc/init.d/mongodb has been modified by you, renaming to .dpkg-bak
dpkg: error processing /var/cache/apt/archives/mongodb-10gen_2.4.8_i386.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-10gen-unstable-mongos 2.5.2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-10gen_2.4.8_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

please see here! worked for me:
install mongodb-10gen failed with apt-get
A bug here https://jira.mongodb.org/browse/SERVER-6910
apt-get remove mongodb-clients
and then the installation of mongodb-10gen should work.

Related

Errors trying to install PostgreSQL on Debian 11

Fail to install PostgreSQL on Debian 11
First time to install package: sudo apt install postgresql
...
Unpacking postgresql (13+225) ...
Setting up postgresql-client-common (225) ...
Setting up libpq5:amd64 (13.5-0+deb11u1) ...
Setting up postgresql-client-13 (13.5-0+deb11u1) ...
double free or corruption (!prev)
dpkg: error processing package postgresql-client-13 (--configure):
installed postgresql-client-13 package post-installation script subprocess was killed by signal (Aborted)
Setting up libz3-4:amd64 (4.8.10-1) ...
Setting up libllvm11:amd64 (1:11.0.1-2) ...
Setting up postgresql-common (225) ...
Adding user postgres to group ssl-cert
Creating config file /etc/postgresql-common/createcluster.conf with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service → /lib/systemd/system/postgresql.service.
dpkg: dependency problems prevent configuration of postgresql-13:
postgresql-13 depends on postgresql-client-13; however:
Package postgresql-client-13 is not configured yet.
dpkg: error processing package postgresql-13 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql:
postgresql depends on postgresql-13; however:
Package postgresql-13 is not configured yet.
dpkg: error processing package postgresql (--configure):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u2) ...
Errors were encountered while processing:
postgresql-client-13
postgresql-13
postgresql
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
Look that package postgresql-client-13 appears with "iF" state (configuration failed) and other failed packages with "iU" state
dpkg -l | grep postgres
iU postgresql 13+225 all object-relational SQL database (supported version)
iU postgresql-13 13.5-0+deb11u1 amd64 The World's Most Advanced Open Source Relational Database
iF postgresql-client-13 13.5-0+deb11u1 amd64 front-end programs for PostgreSQL 13
ii postgresql-client-common 225 all manager for multiple PostgreSQL client versions
ii postgresql-common 225 all PostgreSQL database-cluster manager
Second letter -> current package state:
i ... installed
U ... unpacked
F ... half-configured (configuration failed for some reason)
Get packages states table at:
https://askubuntu.com/questions/18804/what-do-the-various-dpkg-flags-like-ii-rc-mean
I removed all PostgreSQL packages and all files with: sudo apt purge postgresql
After that I tried again to install postgresql-client-13, which returned the error above. sudo apt install postgresql-client-13
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libllvm11 libz3-4
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
postgresql-client-common
Suggested packages:
postgresql-13 postgresql-doc-13
The following NEW packages will be installed:
postgresql-client-13 postgresql-client-common
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,603 kB of archives.
After this operation, 6,789 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package postgresql-client-common.
(Reading database ... 39655 files and directories currently installed.)
Preparing to unpack .../postgresql-client-common_225_all.deb ...
Unpacking postgresql-client-common (225) ...
Selecting previously unselected package postgresql-client-13.
Preparing to unpack .../postgresql-client-13_13.5-0+deb11u1_amd64.deb ...
Unpacking postgresql-client-13 (13.5-0+deb11u1) ...
Setting up postgresql-client-common (225) ...
Setting up postgresql-client-13 (13.5-0+deb11u1) ...
double free or corruption (!prev)
dpkg: error processing package postgresql-client-13 (--configure):
installed postgresql-client-13 package post-installation script subprocess was killed by signal (Aborted)
Processing triggers for man-db (2.9.4-2) ...
Errors were encountered while processing:
postgresql-client-13
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
The problem is related to the existence of the previously installed snoopy package.
Uninstall snoopy with sudo apt remove snoopy and, after that install PostgreSQL or postgresql-client-13.

Problam with apt-get install

I'm using ubuntu 16.04 and last week I try to install some virtual machine on my computer but I failed to do it.
Now when I try to install any program from the apt-get install I got this text:
sudo apt-get install build-essential git libssl-dev
[sudo] password for eliya:
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
git is already the newest version (1:2.7.4-0ubuntu1.5).
libssl-dev is already the newest version (1.0.2g-1ubuntu4.13).
The following packages were automatically installed and are no longer required:
libavdevice-ffmpeg56 linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic
linux-image-4.4.0-134-generic linux-image-extra-4.4.0-134-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up virtualbox-ext-pack (5.1.38-0ubuntu1.16.04.1) ...
removing old virtualbox extension packs
virtualbox-ext-pack: downloading: http://download.virtualbox.org/virtualbox/5.1.38/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack
The file will be downloaded into /usr/share/virtualbox-ext-pack
License accepted.
0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to install "/usr/share/virtualbox-ext-pack/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack"
VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: World writable: '/usr'
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager
VBoxManage: error: Context: "RTEXITCODE handleExtPack(HandlerArg*)" at line 1201 of file VBoxManageMisc.cpp
Hash mismatch Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack: expected e93d87b0f5de50369baca0a48082236b947df5b922ffd0233c0fa92c1206defd, or wrong accept-license key, removing the file.
dpkg: error processing package virtualbox-ext-pack (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
virtualbox-ext-pack
E: Sub-process /usr/bin/dpkg returned an error code (1)
And now i can't install anything because this problam.
Thank you
1.Reconfigure Package Database
sudo dpkg --configure -a
2.force install
sudo apt-get install -f
Then try again installing virtualbox

Install mongodb in ubuntu 16.4 but failled in the first step

Log and error:
sudo apt-get install mongodb-enterprise
Reading package lists... Done
Building dependency tree
Reading state information... Done
mongodb-enterprise is already the newest version (3.4.9).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up ubuntu-make (17.03~xenial1) ...
/var/lib/dpkg/info/ubuntu-make.postinst: 6: /var/lib/dpkg/info/ubuntu-make.postinst: register-python-argcomplete3: not found
dpkg: error processing package ubuntu-make (--configure):
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
ubuntu-make
E: Sub-process /usr/bin/dpkg returned an error code (1)

Installing mongodb 3.2 in Codio using the built-in Terminal (Ubuntu 14.04.3)

I am trying to install mongodb 3.2 into codio using the terminal and I am following the guide on their website here. (I'm new to mongodb and nosql)
I got to Step 4 Installing mongodb using this command:
sudo apt-get install -y mongodb-org
Got the following at the end:
..
The following packages will be upgraded:
mongodb-org
1 upgraded, 0 newly installed, 0 to remove and 51 not upgraded.
2 not fully installed or removed.
Need to get 3,554 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.2/multiverse mongodb-org amd64 3.2.2 [3,554 B]
Fetched 3,554 B in 0s (249 kB/s)
(Reading database ... 37250 files and directories currently installed.)
Preparing to unpack .../mongodb-org_3.2.2_amd64.deb ...
Unpacking mongodb-org (3.2.2) over (3.2.1) ...
Setting up mongodb-org-server (3.2.2) ...
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)
Then I run
sudo service mongod start
or
sudo service mongodb start
Both commands will response with start: Job failed to start or mongodb: unrecognized service
Am I missing something here like e.g. mongodb requires other packages to be installed? following wrong guide version? do I need to create config file? if I do how? because it did not create one, or mongodb doesn't work on codio using the built-in terminal? Is mongodb-org-server already installed or running? I've been searching for exact or similar things, also tried different command but no luck.
This is because of the ulimit settings in the service script of mongod.
Mongodb recommends 64000 for 'open files' key in ulimit settings.
https://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
In codio this is set to 4096.
run the below command in codio terminal and see the 'open files' setting.
ulimit -a
I don't think this value can be changed at OS level in codio. However, we can remove this setting (NOT recommended by MongoDb) from the upstart file.
Steps:
1. To keep it simple and less verbose, start with installing just mongodb-org-server instead of installing the complete mongodb-org.
sudo apt-get install -y mongodb-org-server
2. As we know it fails with errors - '..Job failed to start ..' bla..bla. Just ignore them for a min. Edit '/etc/init/mongod.conf' file as root in whatever editor you like. I like vim. :)
sudo vim /etc/init/mongod.conf
3. Comment out(type '#' at the beginning of the line) the line starts with 'limit nofile' as below. Then save and close the file.
#limit nofile 64000 64000
4. Now install the complete 'mongodb-org' package by running the command in terminal as shown below.
sudo apt-get install -y mongodb-org
5. Go ahead try mongo in terminal now. If the mongod service is running, it connects to the default db successfully.
Hope this helps.
Thank you.

Debian aptitude install: 'find' not found in PATH or not executable

When I try to install any package such as php5, it gives me this error.
I did update and upgrade all libraries.
root#host:~# apt-get install apache2-mpm-prefork libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2-mpm-prefork is already the newest version.
The following extra packages will be installed:
libonig2 libqdbm14 php5-cli php5-common
Suggested packages:
php-pear
The following NEW packages will be installed:
libapache2-mod-php5 libonig2 libqdbm14 php5-cli php5-common
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/6,106 kB of archives.
After this operation, 18.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
debconf: delaying package configuration, since apt-utils is not installed
dpkg: warning: 'find' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
Can someone help me?
There is probably something messed up with the permissions of find, find on your installation is probably located in /usr/bin/find, to check the permissions of this application run
ls -l /usr/bin/find
This should return something like this:
-rwxr-xr-x 1 root root 136152 Oct 26 2010 /usr/bin/find
If this returns an error, try to ls find on other locations in you path (eg. /bin/find, /usr/local/sbin/find)
The first part should be identical for the command to work. If not, reset the permissions to with the following command:
chmod 755 /usr/bin/find
This should fix it.