I'm trying to install mongodb on ubuntu 14.10 following instructions from mongodb manual here . However I get the error chown: invalid group: ‘mongodb:mongodb’ and not able to proceed further with this.
> sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell
mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 56 not upgraded.
..................................
..................................
Setting up mongodb-org-shell (3.4.2) ...
Setting up mongodb-org-server (3.4.2) ...
chown: invalid group: ‘mongodb:mongodb’
dpkg: error processing package mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up mongodb-org-mongos (3.4.2) ...
Setting up mongodb-org-tools (3.4.2) ...
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)
>
Follow this commands, I hope, This will help you.
sudo userdel -r mongodb
sudo groupdel mongodb
sudo adduser mongodb
sudo groupadd mongodb
useradd -G mongodb mongodb
Related
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.
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 7 not upgraded.
Need to get 0 B/98.0 MB of archives.
After this operation, 297 MB of additional disk space will be used.
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 33550 files and directories currently installed.)
Preparing to unpack .../mongodb-org-shell_4.2.11_amd64.deb ...
Unpacking mongodb-org-shell (4.2.11) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../mongodb-org-server_4.2.11_amd64.deb ...
Unpacking mongodb-org-server (4.2.11) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../mongodb-org-mongos_4.2.11_amd64.deb ...
Unpacking mongodb-org-mongos (4.2.11) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../mongodb-org-tools_4.2.11_amd64.deb ...
Unpacking mongodb-org-tools (4.2.11) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../mongodb-org_4.2.11_amd64.deb ...
Unpacking mongodb-org (4.2.11) ...
Setting up mongodb-org-server (4.2.11) ...
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
dpkg: error processing package mongodb-org-server (--configure):
installed mongodb-org-server package post-installation script subprocess returned error exit status 1
Setting up mongodb-org-shell (4.2.11) ...
Setting up mongodb-org-tools (4.2.11) ...
Setting up mongodb-org-mongos (4.2.11) ...
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
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
mongodb-org-server
mongodb-org
E: Sub-process /usr/bin/dpkg returned an error code (1)
Already reinstalled everything and keeps giving me the same error about the mongodb-org-server and mongodb-org, also the dpkg dependency problems and systemd as init system can't really understand much.
Just started learning about Linux because I want to learn Nginx server and such
I am trying to install mongodb 4.4 by using (running as root): apt install -y mongodb-org
but then I got
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
mongodb-org : Depends: mongodb-org-mongos but it is not going to be installed
mongodb-org-tools : Depends: mongodb-database-tools but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
So I use apt --fix-broken install and got:
(Reading database ... 72856 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_4.4.2_amd64.deb ...
Unpacking mongodb-org-server (4.4.2) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.4.2_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_4.4.2_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.2) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.4.2_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1.1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-database-tools_100.2.1_amd64.deb ...
Unpacking mongodb-database-tools (100.2.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.2.1_amd64.deb (--unpack):
trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-server_4.4.2_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.4.2_amd64.deb
/var/cache/apt/archives/mongodb-database-tools_100.2.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
So I try to remove mongodb by using: apt remove mongodb-org and got:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
mongodb-org-tools : Depends: mongodb-database-tools but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
See Mongodb is not updated properly from 4.2 to 4.4.
Remove all installed mongodb packages then install the 4.4 ones.
Use dpkg -l |grep mongodb to find which ones you have installed.
so i installed mongodb in a wrong way , like watched a video of it in youtube even if "mongo" command is working that doesn't mean its really working
so i'm trying to uninstall mongodb-org but i got this error :
sudo apt remove mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
mongodb-org-tools : Depends: mongodb-database-tools but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
when i tried sudo apt --fix-broken install :
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libboost-program-options1.71.0 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.6 mongo-tools mongodb-server-core
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
mongodb-database-tools mongodb-org-mongos mongodb-org-server
The following NEW packages will be installed:
mongodb-database-tools mongodb-org-mongos mongodb-org-server
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
Need to get 90.4 MB of archives.
After this operation, 146 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 mongodb-org-server amd64 4.4.1 [20.3 MB]
8% [1 mongodb-org-server 8,584 kB/20.3 MB 42%] Get:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 mongodb-org-mongos amd64 4.4.1 [15.7 MB]
Get:3 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 mongodb-database-tools amd64 100.1.1 [54.4 MB]
Fetched 90.4 MB in 1min 11s (1,266 kB/s)
(Reading database ... 215423 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_4.4.1_amd64.deb ...
Unpacking mongodb-org-server (4.4.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.4.1_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.9+really3.
6.8+90~g8e540c0b6d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_4.4.1_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.4.1_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.9+really3.
6.8+90~g8e540c0b6d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-database-tools_100.1.1_amd64.deb ...
Unpacking mongodb-database-tools (100.1.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.1.1_amd64.deb (--un
pack):
trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-server_4.4.1_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.4.1_amd64.deb
/var/cache/apt/archives/mongodb-database-tools_100.1.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
when trying this commands :
apt upgrade , autoclean,remove,purge
they give the same first error
i tried sudo apt clean , then sudo apt --fix-broken install the same problem happend and the same response
all i want is to remove it .
In general if you are removing a package and you get that error, and you don't want the other packages that are being kept that want additional dependencies, you can remove all packages in the same command:
sudo apt remove mongodb-org mongodb-org-tools
The problem is with program:
http://manpages.ubuntu.com/manpages/focal/man1/bsondump.1.html
that is installed in package: mongo-tools from mongo v3
You can try:
sudo apt remove mongo-tools
In docs you can read that in mongo v4 this package has name mongodb-database-tools
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
I've been trying for a while now to install mongodb on my docker image in a variety of ways. I've tried using the official image by calling 'docker pull mongo:latest' but for some reason the terminal just hangs with no feedback from docker. I've also tried various ways to build it through Dockerfile but run into an issue when trying to configure mongodb-org-server.
What is the correct way to install mongodb on my docker image? The easiest, I would presume, is to use the docker image for mongo but that's just freezing.
Dockerfile
FROM ubuntu:12.04
FROM ruby:2.2.0
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
RUN echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
RUN apt-get update -qq
RUN apt-get upgrade -y
RUN apt-get install -y build-essential libpq-dev nodejs mongodb-org tcl8.5
# Install redis
RUN wget http://download.redis.io/releases/redis-stable.tar.gz
RUN tar xzf redis-stable.tar.gz
WORKDIR redis-stable
RUN make
RUN make install
WORKDIR utils
RUN ./install_server.sh
RUN service redis_6379 start
RUN mkdir /myapp
WORKDIR /myapp
ADD . /myapp
RUN mv redis.conf /etc/redis/redis.conf.default
RUN redis-server &
#RUN bundle install
#RUN RAILS_ENV=development bundle exec rake assets:precompile --trace
RUN service mongod status
#RUN rake db:mongoid:create_indexes
CMD ["rails", "server", "-b", "0.0.0.0"]
ERROR
Step 6 : RUN apt-get install -y build-essential libpq-dev nodejs mongodb-org tcl8.5
---> Running in bc29e517b3a9
Reading package lists...
Building dependency tree...
Reading state information...
build-essential is already the newest version.
libpq-dev is already the newest version.
The following package was automatically installed and is no longer required:
libbison-dev
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
libc-ares2 libtcl8.5 libv8-3.14.5 mongodb-org-mongos mongodb-org-server
mongodb-org-shell mongodb-org-tools
Suggested packages:
tcl-tclreadline
The following NEW packages will be installed:
libc-ares2 libtcl8.5 libv8-3.14.5 mongodb-org mongodb-org-mongos
mongodb-org-server mongodb-org-shell mongodb-org-tools nodejs tcl8.5
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 53.6 MB of archives.
After this operation, 168 MB of additional disk space will be used.
Get:1 http://repo.mongodb.org/apt/ubuntu/ precise/mongodb-org/3.0/multiverse mongodb-org-shell amd64 3.0.6 [4258 kB]
Get:2 http://http.debian.net/debian/ jessie/main libtcl8.5 amd64 8.5.17-1 [737 kB]
Get:3 http://repo.mongodb.org/apt/ubuntu/ precise/mongodb-org/3.0/multiverse mongodb-org-server amd64 3.0.6 [8632 kB]
Get:4 http://http.debian.net/debian/ jessie/main libc-ares2 amd64 1.10.0-2 [76.7 kB]
Get:5 http://http.debian.net/debian/ jessie/main nodejs amd64 0.10.29~dfsg-2 [648 kB]
Get:6 http://http.debian.net/debian/ jessie/main tcl8.5 amd64 8.5.17-1 [58.6 kB]
Get:7 http://http.debian.net/debian/ jessie/main libv8-3.14.5 amd64 3.14.5.8-8.1 [1269 kB]
Get:8 http://repo.mongodb.org/apt/ubuntu/ precise/mongodb-org/3.0/multiverse mongodb-org-mongos amd64 3.0.6 [4043 kB]
Get:9 http://repo.mongodb.org/apt/ubuntu/ precise/mongodb-org/3.0/multiverse mongodb-org-tools amd64 3.0.6 [33.8 MB]
Get:10 http://repo.mongodb.org/apt/ubuntu/ precise/mongodb-org/3.0/multiverse mongodb-org amd64 3.0.6 [3616 B]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 53.6 MB in 11s (4850 kB/s)
Selecting previously unselected package libtcl8.5:amd64.
(Reading database ... 27887 files and directories currently installed.)
Preparing to unpack .../libtcl8.5_8.5.17-1_amd64.deb ...
Unpacking libtcl8.5:amd64 (8.5.17-1) ...
Selecting previously unselected package libc-ares2:amd64.
Preparing to unpack .../libc-ares2_1.10.0-2_amd64.deb ...
Unpacking libc-ares2:amd64 (1.10.0-2) ...
Selecting previously unselected package libv8-3.14.5.
Preparing to unpack .../libv8-3.14.5_3.14.5.8-8.1_amd64.deb ...
Unpacking libv8-3.14.5 (3.14.5.8-8.1) ...
Selecting previously unselected package mongodb-org-shell.
Preparing to unpack .../mongodb-org-shell_3.0.6_amd64.deb ...
Unpacking mongodb-org-shell (3.0.6) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../mongodb-org-server_3.0.6_amd64.deb ...
Unpacking mongodb-org-server (3.0.6) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../mongodb-org-mongos_3.0.6_amd64.deb ...
Unpacking mongodb-org-mongos (3.0.6) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../mongodb-org-tools_3.0.6_amd64.deb ...
Unpacking mongodb-org-tools (3.0.6) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../mongodb-org_3.0.6_amd64.deb ...
Unpacking mongodb-org (3.0.6) ...
Selecting previously unselected package tcl8.5.
Preparing to unpack .../tcl8.5_8.5.17-1_amd64.deb ...
Unpacking tcl8.5 (8.5.17-1) ...
Selecting previously unselected package nodejs.
Preparing to unpack .../nodejs_0.10.29~dfsg-2_amd64.deb ...
Unpacking nodejs (0.10.29~dfsg-2) ...
Processing triggers for systemd (215-17+deb8u2) ...
Setting up libtcl8.5:amd64 (8.5.17-1) ...
Setting up libc-ares2:amd64 (1.10.0-2) ...
Setting up libv8-3.14.5 (3.14.5.8-8.1) ...
Setting up mongodb-org-shell (3.0.6) ...
Setting up mongodb-org-server (3.0.6) ...
Adding system user `mongodb' (UID 105) ...
Adding new user `mongodb' (UID 105) with group `nogroup' ...
Not creating home directory `/home/mongodb'.
Adding group `mongodb' (GID 109) ...
Done.
Adding user `mongodb' to group `mongodb' ...
Adding user mongodb to group mongodb
Done.
invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing package mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 100
Setting up mongodb-org-mongos (3.0.6) ...
Setting up mongodb-org-tools (3.0.6) ...
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
Setting up tcl8.5 (8.5.17-1) ...
Setting up nodejs (0.10.29~dfsg-2) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Processing triggers for libc-bin (2.19-18+deb8u1) ...
Errors were encountered while processing:
mongodb-org-server
mongodb-org
E: Sub-process /usr/bin/dpkg returned an error code (1)
Service 'web' failed to build: The command '/bin/sh -c apt-get install -y build-essential libpq-dev nodejs mongodb-org tcl8.5' returned a non-zero code: 100
I think this is a duplicate of https://stackoverflow.com/a/16575040/880056
Summary: you're trying to install a new version of MongoDB which is packaged for Upstart init services, but the version of Ubuntu you're running still uses SysV init scripts.
Any reason you're using such an old Ubuntu version (12.04)?