Unable to install mongodb on linux - linux

I am using sudo apt-get install mongodb command but it is giving me error , i think there is problem with packaging but i am unable to find it.
mongodb start/running, process 15259
Can't exec "/sbin/insserv": No such file or directory at /usr/sbin/update-rc.d line 382.
update-rc.d: error: insserv rejected the script header
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: error processing package mongodb-server (--configure):
subprocess installed post-installation script returned error exit status 255
dpkg: dependency problems prevent configuration of mongodb:
mongodb depends on mongodb-server (>= 1:2.4.1-2); however:
Package mongodb-server is not configured yet.
dpkg: error processing package mongodb (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
postfix
mongodb-server
mongodb
E: Sub-process /usr/bin/dpkg returned an error code (1)

With version 3.0 MongoDB has split the package into parts. E.g. you may install just mongo shell. Take a look at this article.

This was some time back. I have mongo working OK
Un install anything you have NOW ... There is a default Mongo comes with Ubuntu.
Visit the Ubuntu Mongo-shell installation.
Install Mongo on Ubuntu
The other Install-s appear to depend on the shell install. I find that refreshing actually. I wish real databases(tm) would pay attention. Things USED-TO work like that. All the time. Wow.
The other useful tidbits are ...
stop
restart
start
And
configuration.
file: /etc/mongod.conf
see also: /etc/init.d/README file.
A very useful engine ... w

You can try this
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt-get update
sudo apt-get install -y mongodb-org
more details
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/

Related

Error when installing libapache2-mod-fastcgi for apache2

When i'm trying to install libapache2-mod-fastcgi for apache as following:
OS: Ubuntu 14.04
root#server:~# sudo apt-get install libapache2-mod-fastcgi
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-fastcgi is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 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 libapache2-mod-fastcgi (2.4.7~0910052141-1.1) ...
dpkg: error processing package libapache2-mod-fastcgi (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-fastcgi
E: Sub-process /usr/bin/dpkg returned an error code (1)
What's wrong ? I've done this before on Ubuntu, But this time an error came up.
Both sudo dpkg --configure -a and sudo apt-get install -f
Setting up libapache2-mod-fastcgi (2.4.7~0910052141-1.1) ...
dpkg: error processing package libapache2-mod-fastcgi (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-fastcgi
There was a better solution (yours doesn't works for me):
Uninstall the module
sudo apt-get remove --auto-remove libapache2-mod-fastcgi
Purge config/data
sudo apt-get purge --auto-remove libapache2-mod-fastcgi
Then you can install the module
sudo apt-get install libapache2-mod-fastcgi

Ubuntu 12.04 update to the 3.8 kernel fails [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I've been trying to update the kernel on our Linux server running Ubuntu 12.04.5 LTS.
Running uname -r displays 2.6.32-042stab113.11 as the current version.
I've run the usual apt-get update to get the latest packages.
I've run the following command:
apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
This outputs the information below with the final lines outputting:
Errors were encountered while processing:
linux-image-3.8.0-44-generic
linux-image-generic-lts-raring
E: Sub-process /usr/bin/dpkg returned an error code (1)
Further up the output is another error:
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.8.0-44-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.8.0-44-generic.postinst line 1010.
dpkg: error processing linux-image-3.8.0-44-generic (--configure):
subprocess installed post-installation script returned error exit status 2
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of linux-image-generic-lts-raring:
linux-image-generic-lts-raring depends on linux-image-3.8.0-44-generic; however:
Package linux-image-3.8.0-44-generic is not configured yet.
I've tried running apt-get autoclean, apt-get -f install to fix broken packages.
I am wondering if I could do apt-get remove linux-image-3.8.0-44-generic
linux-image-generic-lts-raring and then install again.
Should I run apt-get upgrade.
I've been reluctant to do this so far in case it breaks the server and puts our sites offline.
Any advice?
Full Output from terminal:
root#213-xx-xxx-xx:/var/www/vhosts/example.com# apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-generic-lts-raring is already the newest version.
linux-image-generic-lts-raring is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 176 not upgraded.
2 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
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up linux-image-3.8.0-44-generic (3.8.0-44.66~precise1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.8.0-44-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.8.0-44-generic /boot/vmlinuz-3.8.0-44-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.8.0-44-generic /boot/vmlinuz-3.8.0-44-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.8.0-44-generic /boot/vmlinuz-3.8.0-44-generic
update-initramfs: Generating /boot/initrd.img-3.8.0-44-generic
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.8.0-44-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.8.0-44-generic.postinst line 1010.
dpkg: error processing linux-image-3.8.0-44-generic (--configure):
subprocess installed post-installation script returned error exit status 2
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of linux-image-generic-lts-raring:
linux-image-generic-lts-raring depends on linux-image-3.8.0-44-generic; however:
Package linux-image-3.8.0-44-generic is not configured yet.
dpkg: error processing linux-image-generic-lts-raring (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-3.8.0-44-generic
linux-image-generic-lts-raring
E: Sub-process /usr/bin/dpkg returned an error code (1)
Try the following:
apt-get autoclean
apt-get clean
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get -f install
dpkg --configure -a
This should be fixing the problem.
Try
sudo chmod -x /usr/share/initramfs-tools/hooks/fixrtc
as suggested here.
This disables the fixrtc hook, which is not in all cases needed.
You can undo this step with
sudo chmod +x /usr/share/initramfs-tools/hooks/fixrtc

How do I fix broken dependencies if apt-get --fix-broken is giving me a "not known" error?

I've been attempting to install OpenLDAP on Ubuntu, but I keep receiving a dependency error whenever I try to install it.
The console output is:
dpkg: error processing package libapache2-mpm-itk (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of apache2-mpm-itk:
apache2-mpm-itk depends on libapache2-mpm-itk; however:
Package libapache2-mpm-itk is not configured yet.
dpkg: error processing package apache2-mpm-itk (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
libapache2-mpm-itk
apache2-mpm-itk
I tried running the code below to fix these errors:
sudo apt-get -f
But I received the error:
E: Command line option 'f' [from -f] is not known.
I have also tried to use the alternative --fix-broken, but I get the same error. Has anyone ever experience this and know a way around this?
First you'll have to resolve the problem with libapache2-mpm-itk. There isn't enough info in what you posted above to see why it's failing to install, but a quick workaround would be to just remove it:
sudo apt-get purge libapache2-mpm-itk apache2-mpm-itk
After that you should be able to install other packages again.
-f has to be used with an action, for example: sudo apt-get -f install (you don't need to provide any packages names when doing this.)
Whilst
sudo apt --fix-broken install
should work to repair damage. You might also find
sudo apt-get -f install
yeilds better result. Even though it's meant to be same.
You need to run sudo apt-get -f install NOT just sudo apt-get -f.

Can't remove, purge, unistall mongodb from debian

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 autoremove --purge mongodb
Or:
apt-get purge mongodb
Or:
apt-get remove --purge mongodb
All end in the same way:
dpkg: error processing package mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 102
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Some data about my machine from hostnamectl:
Operating System: Debian GNU/Linux 8 (jessie)
Kernel: Linux 3.14-2-amd64
Architecture: x86_64
How can I fix this?
Updates: things I tried/I'm trying
apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 973 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mongodb-org-server (3.0.2) ...
dpkg: error processing package mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 102
Errors were encountered while processing:
mongodb-org-server
To avoid that sort of problems you should install software only from native Debian repositories. Unfortunately it is not unusual when sloppy/incompetent 3rd party packages are responsible for such troubles.
To recover try removing file /var/lib/dpkg/info/mongodb-org-server.postinst before attempting to apt-get purge mongodb.
Remove all mongodb file inside
/var/lib/dpkg/info/mongodb
And then do
sudo apt purge mongodb-org*
Answer credits to: Lazyexpert

Why is MongoDB unable to create a user on Ubuntu 11.10 when installing?

I am installing MongoDB on my Ubuntu 11.10 machine. After adding the appropriate line to /etc/apt/sources.list (using instructions from here), I type the following to install:
sudo apt-get install mongodb-10gen
It results in the following output:
Adding system user `mongodb' (UID 117) ...
Adding new user `mongodb' (UID 117) with group `nogroup' ...
useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /home/mongodb -g nogroup -s /bin/false -u 117 mongodb' returned error code 1. Exiting.
dpkg: error processing mongodb-10gen (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)
I only have other terminal windows open (none of them running any programs) and Chromium open. Why might the install not be able to add a user?
Thanks,
ParagonRG
Solution, thanks to 'Thomas', from the this resource:
Look for /etc/group.lock, /etc/passwd.lock, and /etc/shadow.lock, and remove them. Make sure you're ONLY removing these files if they exist.
After doing this, I simply re-ran the install command and it successfully completed.

Resources