Error building custom Docker image with Postgres and security updates: "configuration file createcluster.conf is available" - postgresql

I have a Dockerfile that builds an image based on postgres, but additionally installs security updates (this is to ensure that the image has the latest patches even if a release is slightly older).
This is the Dockerfile:
FROM postgres:14.2
# apply security updates
RUN \
apt-get update -qq && \
apt-get upgrade -y && \
rm -rf /var/lib/apt/lists/*
ENV PGDATA /var/lib/postgresql/data
# switch to lower-privileged user
USER 999
CMD ["postgres", "-c", "listen_addresses=*", "-c", "config_file=/etc/postgresql/postgresql.conf"]
Now, this build broke:
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
libpq5 postgresql-14 postgresql-client-14 postgresql-client-common
postgresql-common
5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.9 MB of archives.
After this operation, 25.6 kB of additional disk space will be used.
Get:1 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main amd64 libpq5 amd64 14.3-1.pgdg110+1 [172 kB]
Get:2 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main amd64 postgresql-common all 241.pgdg110+1 [230 kB]
Get:3 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main amd64 postgresql-client-common all 241.pgdg110+1 [92.1 kB]
Get:4 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main amd64 postgresql-client-14 amd64 14.3-1.pgdg110+1 [1,629 kB]
Get:5 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg/main amd64 postgresql-14 amd64 14.3-1.pgdg110+1 [15.8 MB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 17.9 MB in 1s (25.4 MB/s)
(Reading database ... 12100 files and directories currently installed.)
Preparing to unpack .../libpq5_14.3-1.pgdg110+1_amd64.deb ...
Unpacking libpq5:amd64 (14.3-1.pgdg110+1) over (14.2-1.pgdg110+1) ...
Preparing to unpack .../postgresql-common_241.pgdg110+1_all.deb ...
Leaving 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Unpacking postgresql-common (241.pgdg110+1) over (238.pgdg110+1) ...
Preparing to unpack .../postgresql-client-common_241.pgdg110+1_all.deb ...
Unpacking postgresql-client-common (241.pgdg110+1) over (238.pgdg110+1) ...
Preparing to unpack .../postgresql-client-14_14.3-1.pgdg110+1_amd64.deb ...
Unpacking postgresql-client-14 (14.3-1.pgdg110+1) over (14.2-1.pgdg110+1) ...
Preparing to unpack .../postgresql-14_14.3-1.pgdg110+1_amd64.deb ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of stop.
Unpacking postgresql-14 (14.3-1.pgdg110+1) over (14.2-1.pgdg110+1) ...
Setting up postgresql-client-common (241.pgdg110+1) ...
Setting up libpq5:amd64 (14.3-1.pgdg110+1) ...
Setting up postgresql-client-14 (14.3-1.pgdg110+1) ...
Setting up postgresql-common (241.pgdg110+1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Configuring postgresql-common
-----------------------------
createcluster.conf: A new version (/tmp/postgresql-common.sK2jGD) of
configuration file /etc/postgresql-common/createcluster.conf is available, but
the version installed currently has been locally modified.
1. install the package maintainer's version
2. keep the local version currently installed
3. show the differences between the versions
4. show a side-by-side difference between the versions
5. start a new shell to examine the situation
What do you want to do about modified configuration file createcluster.conf?
How can I solve this problem?

The build breaks because it asks you what to do, and from a script (or automated build), this is not possible.
The solution is to allow apt to configure the installation noninteractively. Add to your Dockerfile:
ENV DEBIAN_FRONTEND=noninteractive
This way, automatic selections to the packages will apply. This is fine for most cases.

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.

mongoDB in Ubuntu 20.04 Problems

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/

Cannot install MongoDB on Beaglebone Green

The installation of MongoDB is still unsuccessful on the BeagleBone Green card.
More information about this BBG:
debian#beaglebone:/var/lib/cloud9$ uname -a
Linux beaglebone 4.9.82-ti-r102 #1 SMP PREEMPT Thu Feb 22 01:16:12 UTC 2018 armv7l GNU/Linux
debian#beaglebone:/var/lib/cloud9$ cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Even I tried to follow this tutorial : https://docs.mongodb.com/v3.0/tutorial/install-mongodb-on-debian/ as below :
debian#beaglebone:/var/lib/cloud9$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
Executing: /tmp/apt-key-gpghome.jgT79mhjhQ/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
gpg: key 58712A2291FA4AD5: "MongoDB 3.6 Release Signing Key <packaging#mongodb.com>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
debian#beaglebone:/var/lib/cloud9$ echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.6 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.6 main
debian#beaglebone:/var/lib/cloud9$ echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/{+package-branch+} main" | sudo tee /etc/apt/sources.list.d/mongodb-org-{+version+}.list
deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/{+package-branch+} main
debian#beaglebone:/var/lib/cloud9$ sudo apt-get update
Ign:1 http://deb.debian.org/debian stretch InRelease
Hit:2 http://deb.debian.org/debian stretch-updates InRelease
Get:3 http://deb.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:4 http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.6 InRelease
Hit:5 http://repos.rcn-ee.com/debian stretch InRelease
Hit:6 http://deb.debian.org/debian stretch Release
Get:7 http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.6 Release [2393 B]
Get:8 http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.6 Release.gpg [801 B]
Fetched 97.5 kB in 5s (17.8 kB/s)
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-armhf/Packages' as repository 'http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.6 InRelease' doesn't support architecture 'armhf'
debian#beaglebone:/var/lib/cloud9$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mongodb-org
debian#beaglebone:/var/lib/cloud9$ sudo apt-get install -y mongodb-org=3.6.4 mongodb-org-server=3.6.4 mongodb-org-shell=3.6.4 mongodb-org-mongos=3.6.4 mongodb-org-tools=3.6.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mongodb-org
E: Unable to locate package mongodb-org-server
E: Unable to locate package mongodb-org-shell
E: Unable to locate package mongodb-org-mongos
E: Unable to locate package mongodb-org-tools
debian#beaglebone:/var/lib/cloud9$ echo "mongodb-org hold" | sudo dpkg --set-selections
dpkg: warning: package not in status nor available database at line 1: mongodb-org
dpkg: warning: found unknown packages; this might mean the available database
is outdated, and needs to be updated through a frontend method;
please see the FAQ <https://wiki.debian.org/Teams/Dpkg/FAQ>
debian#beaglebone:/var/lib/cloud9$ echo "mongodb-org-server hold" | sudo dpkg --set-selections
dpkg: warning: package not in status nor available database at line 1: mongodb-org-server
dpkg: warning: found unknown packages; this might mean the available database
is outdated, and needs to be updated through a frontend method;
please see the FAQ <https://wiki.debian.org/Teams/Dpkg/FAQ>
debian#beaglebone:/var/lib/cloud9$ echo "mongodb-org-shell hold" | sudo dpkg --set-selections
dpkg: warning: package not in status nor available database at line 1: mongodb-org-shell
dpkg: warning: found unknown packages; this might mean the available database
is outdated, and needs to be updated through a frontend method;
please see the FAQ <https://wiki.debian.org/Teams/Dpkg/FAQ>
debian#beaglebone:/var/lib/cloud9$ echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
dpkg: warning: package not in status nor available database at line 1: mongodb-org-mongos
dpkg: warning: found unknown packages; this might mean the available database
is outdated, and needs to be updated through a frontend method;
please see the FAQ <https://wiki.debian.org/Teams/Dpkg/FAQ>
debian#beaglebone:/var/lib/cloud9$ echo "mongodb-org-tools hold" | sudo dpkg --set-selections
dpkg: warning: package not in status nor available database at line 1: mongodb-org-tools
dpkg: warning: found unknown packages; this might mean the available database
is outdated, and needs to be updated through a frontend method;
please see the FAQ <https://wiki.debian.org/Teams/Dpkg/FAQ>
but the problem is still the same.
How can I fix this issue please?
There is no ARMv7-HF package offered by that repository.
The easiest option is to go with the Debian package:
sudo apt install mongodb
This will yield version 3.2.11 as indicated here: https://packages.debian.org/stretch/mongodb
The more complicated option is to build it from source. This will potentially take a very long time if you do it directly on the BBB!
A rough guess at steps would be:
This pulls in build dependencies for the debian mongodb, which may be sufficient, but at least should provide a decent base:
sudo apt build-dep mongo
Download source code - as of the time of me writing this it would be:
wget https://fastdl.mongodb.org/src/mongodb-src-r3.6.5.tar.gz
Unpack: tar -xvzf mongodb-src-r3.6.5.tar.gz
Change directory into source: cd mongodb-src-r3.6.5
Build debian package from source: dpkg-buildpackage -b
Install build results: dpkg -i ../mongodb-org-bla-foo.deb
The build step might possibly fail for a variety of reasons, e.g. unresolved dependencies. Please make sure to download the latest version to avoid exposing yourself to security issues and stability problems, the above mentioned URL is just an example and only valid at the time of writing.

Kubernetes' Kubeadm stops at apiclient

I have created a new Ubuntu 16.04 droplet on DigitalOcean and followed those guides respectively to install kubeadm (and its dependencies):
https://docs.docker.com/engine/installation/
https://kubernetes.io/docs/tasks/tools/install-kubectl/
https://kubernetes.io/docs/setup/independent/install-kubeadm/
However, when I run kubeadm init, I get:
root#ubuntu-512mb-nyc3-01:~# kubeadm init
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[init] Using Kubernetes version: v1.7.3
[init] Using Authorization modes: [Node RBAC]
[preflight] Running pre-flight checks
[preflight] WARNING: docker version is greater than the most recently validated version. Docker version: 17.06.0-ce. Max validated version: 1.12
[kubeadm] WARNING: starting in 1.8, tokens expire after 24 hours by default (if you require a non-expiring token use --token-ttl 0)
[certificates] Generated CA certificate and key.
[certificates] Generated API server certificate and key.
[certificates] API Server serving cert is signed for DNS names [ubuntu-512mb-nyc3-01 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 165.227.70.168]
[certificates] Generated API server kubelet client certificate and key.
[certificates] Generated service account token signing key and public key.
[certificates] Generated front-proxy CA certificate and key.
[certificates] Generated front-proxy client certificate and key.
[certificates] Valid certificates and keys now exist in "/etc/kubernetes/pki"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/controller-manager.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/scheduler.conf"
[apiclient] Created API client, waiting for the control plane to become ready
I even tried to create a new CentOS 7 droplet to apply the different instructions for CentOS, and I got the same problem.
Here's the full history for what I applied since I created the VPS:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
0 packages can be updated.
0 updates are security updates.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
Changing password for root.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
root#ubuntu-512mb-nyc3-01:~# apt update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:2 http://nyc2.mirrors.digitalocean.com/ubuntu xenial InRelease
Get:3 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates InRelease [102 kB]
Get:4 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-backports InRelease [102 kB]
Get:5 http://nyc2.mirrors.digitalocean.com/ubuntu xenial/main Sources [868 kB]
Get:6 http://nyc2.mirrors.digitalocean.com/ubuntu xenial/restricted Sources [4,808 B]
Get:7 http://nyc2.mirrors.digitalocean.com/ubuntu xenial/universe Sources [7,728 kB]
Get:8 http://nyc2.mirrors.digitalocean.com/ubuntu xenial/multiverse Sources [179 kB]
Get:9 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates/main Sources [265 kB]
Get:10 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates/restricted Sources [3,012 B]
Get:11 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates/universe Sources [166 kB]
Get:12 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates/multiverse Sources [7,232 B]
Get:13 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 Packages [593 kB]
Get:14 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates/main Translation-en [240 kB]
Get:15 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates/universe amd64 Packages [511 kB]
Get:16 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates/universe Translation-en [199 kB]
Get:17 http://security.ubuntu.com/ubuntu xenial-security/main Sources [86.5 kB]
Get:18 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-backports/main Sources [3,312 B]
Get:19 http://security.ubuntu.com/ubuntu xenial-security/restricted Sources [2,604 B]
Get:21 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [38.2 kB]
Get:20 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-backports/universe Sources [4,400 B]
Get:22 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-backports/universe amd64 Packages [5,804 B]
Get:23 http://security.ubuntu.com/ubuntu xenial-security/multiverse Sources [1,144 B]
Get:24 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [341 kB]
Get:25 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [144 kB]
Get:26 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [155 kB]
Get:27 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [79.4 kB]
Get:28 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [2,752 B]
Fetched 11.9 MB in 3s (3,327 kB/s)
ade
Reading package lists... Done
Building dependency tree
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
root#ubuntu-512mb-nyc3-01:~# apt pgrade
E: Invalid operation pgrade
root#ubuntu-512mb-nyc3-01:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
linux-headers-4.4.0-91 linux-headers-4.4.0-91-generic
linux-image-4.4.0-91-generic
The following packages will be upgraded:
git git-man linux-headers-generic linux-headers-virtual
linux-image-virtual linux-virtual
6 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 36.5 MB of archives.
After this operation, 145 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 git-man all 1:2.7.4-0ubuntu1.2 [736 kB]
Get:2 http://security.ubuntu.com/ubuntu xenial-security/main amd64 git amd64 1:2.7.4-0ubuntu1.2 [3,163 kB]
Get:3 http://security.ubuntu.com/ubuntu xenial-security/main amd64 linux-headers-4.4.0-91 all 4.4.0-91.114 [9,876 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security/main amd64 linux-headers-4.4.0-91-generic amd64 4.4.0-91.114 [791 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 linux-image-4.4.0-91-generic amd64 4.4.0-91.114 [21.9 MB]
Get:6 http://security.ubuntu.com/ubuntu xenial-security/main amd64 linux-virtual amd64 4.4.0.91.96 [1,780 B]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/main amd64 linux-image-virtual amd64 4.4.0.91.96 [2,270 B]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/main amd64 linux-headers-virtual amd64 4.4.0.91.96 [1,760 B]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 linux-headers-generic amd64 4.4.0.91.96 [2,262 B]
Fetched 36.5 MB in 0s (40.0 MB/s)
(Reading database ... 54209 files and directories currently installed.)
Preparing to unpack .../git-man_1%3a2.7.4-0ubuntu1.2_all.deb ...
Unpacking git-man (1:2.7.4-0ubuntu1.2) over (1:2.7.4-0ubuntu1.1) ...
Preparing to unpack .../git_1%3a2.7.4-0ubuntu1.2_amd64.deb ...
Unpacking git (1:2.7.4-0ubuntu1.2) over (1:2.7.4-0ubuntu1.1) ...
Selecting previously unselected package linux-headers-4.4.0-91.
Preparing to unpack .../linux-headers-4.4.0-91_4.4.0-91.114_all.deb ...
Unpacking linux-headers-4.4.0-91 (4.4.0-91.114) ...
Selecting previously unselected package linux-headers-4.4.0-91-generic.
Preparing to unpack .../linux-headers-4.4.0-91-generic_4.4.0-91.114_amd64.deb ...
Unpacking linux-headers-4.4.0-91-generic (4.4.0-91.114) ...
Selecting previously unselected package linux-image-4.4.0-91-generic.
Preparing to unpack .../linux-image-4.4.0-91-generic_4.4.0-91.114_amd64.deb ...
Done.
Unpacking linux-image-4.4.0-91-generic (4.4.0-91.114) ...
Preparing to unpack .../linux-virtual_4.4.0.91.96_amd64.deb ...
Unpacking linux-virtual (4.4.0.91.96) over (4.4.0.87.93) ...
Preparing to unpack .../linux-image-virtual_4.4.0.91.96_amd64.deb ...
Unpacking linux-image-virtual (4.4.0.91.96) over (4.4.0.87.93) ...
Preparing to unpack .../linux-headers-virtual_4.4.0.91.96_amd64.deb ...
Unpacking linux-headers-virtual (4.4.0.91.96) over (4.4.0.87.93) ...
Preparing to unpack .../linux-headers-generic_4.4.0.91.96_amd64.deb ...
Unpacking linux-headers-generic (4.4.0.91.96) over (4.4.0.87.93) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up git-man (1:2.7.4-0ubuntu1.2) ...
Setting up git (1:2.7.4-0ubuntu1.2) ...
Setting up linux-headers-4.4.0-91 (4.4.0-91.114) ...
Setting up linux-headers-4.4.0-91-generic (4.4.0-91.114) ...
Setting up linux-image-4.4.0-91-generic (4.4.0-91.114) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-91-generic /boot/vmlinuz-4.4.0-91-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-91-generic /boot/vmlinuz-4.4.0-91-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-91-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-91-generic /boot/vmlinuz-4.4.0-91-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-91-generic /boot/vmlinuz-4.4.0-91-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-91-generic /boot/vmlinuz-4.4.0-91-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-91-generic
Found initrd image: /boot/initrd.img-4.4.0-91-generic
Found linux image: /boot/vmlinuz-4.4.0-87-generic
Found initrd image: /boot/initrd.img-4.4.0-87-generic
done
Setting up linux-image-virtual (4.4.0.91.96) ...
Setting up linux-headers-generic (4.4.0.91.96) ...
Setting up linux-headers-virtual (4.4.0.91.96) ...
Setting up linux-virtual (4.4.0.91.96) ...
root#ubuntu-512mb-nyc3-01:~# sudo apt-get install \
> apt-transport-https \
> ca-certificates \
> curl \
> software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20160104ubuntu1).
apt-transport-https is already the newest version (1.2.24).
curl is already the newest version (7.47.0-1ubuntu2.2).
software-properties-common is already the newest version (0.96.20.7).
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root#ubuntu-512mb-nyc3-01:~# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK
root#ubuntu-512mb-nyc3-01:~# sudo add-apt-repository \
> "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
> $(lsb_release -cs) \
> stable"
root#ubuntu-512mb-nyc3-01:~# apt update
Hit:1 http://mirrors.digitalocean.com/ubuntu xenial InRelease
Hit:2 http://mirrors.digitalocean.com/ubuntu xenial-updates InRelease
Hit:3 http://mirrors.digitalocean.com/ubuntu xenial-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Get:5 https://download.docker.com/linux/ubuntu xenial InRelease [38.9 kB]
Get:6 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages [1,966 B]
Fetched 40.9 kB in 0s (56.7 kB/s)
sudo apt-get install docker-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
root#ubuntu-512mb-nyc3-01:~# sudo apt-get install docker-ce
Reading package lists... Done
Building dependency tree... 50%
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
aufs-tools cgroupfs-mount libltdl7
Suggested packages:
mountall
The following NEW packages will be installed:
aufs-tools cgroupfs-mount docker-ce libltdl7
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.6 MB of archives.
After this operation, 96.6 MB of additional disk space will be used.
Get:2 https://download.docker.com/linux/ubuntu xenial/stable amd64 docker-ce amd64 17.06.0~ce-0~ubuntu [20.5 MB]
Get:1 http://nyc2.mirrors.digitalocean.com/ubuntu xenial/universe amd64 aufs-tools amd64 1:3.2+20130722-1.1ubuntu1 [92.9 kB]
Get:3 http://nyc2.mirrors.digitalocean.com/ubuntu xenial/universe amd64 cgroupfs-mount all 1.2 [4,970 B]
Get:4 http://nyc2.mirrors.digitalocean.com/ubuntu xenial/main amd64 libltdl7 amd64 2.4.6-0.1 [38.3 kB]
Fetched 20.6 MB in 0s (23.2 MB/s)
Selecting previously unselected package aufs-tools.
(Reading database ... 82102 files and directories currently installed.)
Preparing to unpack .../aufs-tools_1%3a3.2+20130722-1.1ubuntu1_amd64.deb ...
Unpacking aufs-tools (1:3.2+20130722-1.1ubuntu1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../cgroupfs-mount_1.2_all.deb ...
Unpacking cgroupfs-mount (1.2) ...
Selecting previously unselected package libltdl7:amd64.
Preparing to unpack .../libltdl7_2.4.6-0.1_amd64.deb ...
Unpacking libltdl7:amd64 (2.4.6-0.1) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../docker-ce_17.06.0~ce-0~ubuntu_amd64.deb ...
Unpacking docker-ce (17.06.0~ce-0~ubuntu) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu19) ...
Setting up aufs-tools (1:3.2+20130722-1.1ubuntu1) ...
Setting up cgroupfs-mount (1.2) ...
Setting up libltdl7:amd64 (2.4.6-0.1) ...
Setting up docker-ce (17.06.0~ce-0~ubuntu) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
root#ubuntu-512mb-nyc3-01:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b04784fba78d: Pull complete
Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
root#ubuntu-512mb-nyc3-01:~# curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 1 68.9M 1 995k 0 0 2613k 0 0:00:27 --:--:-- 0:00:27 100 68.9M 100 68.9M 0 0 72.8M 0 --:--:-- --:--:-- --:--:-- 72.8M
root#ubuntu-512mb-nyc3-01:~# chmod +x ./kubectl
root#ubuntu-512mb-nyc3-01:~# sudo mv ./kubectl /usr/local/bin/kubectl
root#ubuntu-512mb-nyc3-01:~# kubectl cluster-info
Kubernetes master is running at http://localhost:8080
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
root#ubuntu-512mb-nyc3-01:~#
root#ubuntu-512mb-nyc3-01:~# apt-get update && apt-get install -y apt-transport-https
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:2 http://nyc2.mirrors.digitalocean.com/ubuntu xenial InRelease
Hit:3 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates InRelease
Hit:4 https://download.docker.com/linux/ubuntu xenial InRelease
Hit:5 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-backports InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-transport-https is already the newest version (1.2.24).
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root#ubuntu-512mb-nyc3-01:~# curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
OK
root#ubuntu-512mb-nyc3-01:~# cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
> deb http://apt.kubernetes.io/ kubernetes-xenial main
> EOF
root#ubuntu-512mb-nyc3-01:~# apt-get update
Hit:1 http://mirrors.digitalocean.com/ubuntu xenial InRelease
Hit:2 http://mirrors.digitalocean.com/ubuntu xenial-updates InRelease
Hit:3 http://mirrors.digitalocean.com/ubuntu xenial-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:6 https://download.docker.com/linux/ubuntu xenial InRelease
Get:5 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [8,942 B]
Get:7 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 Packages [4,977 B]
Fetched 13.9 kB in 0s (16.0 kB/s)
Reading package lists... Done
root#ubuntu-512mb-nyc3-01:~# apt-get install -y kubelet kubeadm
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
ebtables kubectl kubernetes-cni socat
The following NEW packages will be installed:
ebtables kubeadm kubectl kubelet kubernetes-cni socat
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 45.4 MB of archives.
After this operation, 334 MB of additional disk space will be used.
Get:1 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 ebtables amd64 2.0.10.4-3.4ubuntu2 [79.4 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu xenial/universe amd64 socat amd64 1.7.3.1-1 [321 kB]
Get:3 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 kubernetes-cni amd64 0.5.1-00 [5,560 kB]
Get:4 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 kubelet amd64 1.7.3-01 [19.6 MB]
Get:5 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 kubectl amd64 1.7.3-01 [10.1 MB]
Get:6 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 kubeadm amd64 1.7.3-01 [9,796 kB]
Fetched 45.4 MB in 4s (10.2 MB/s)
Selecting previously unselected package ebtables.
(Reading database ... 82383 files and directories currently installed.)
Preparing to unpack .../ebtables_2.0.10.4-3.4ubuntu2_amd64.deb ...
Unpacking ebtables (2.0.10.4-3.4ubuntu2) ...
Selecting previously unselected package kubernetes-cni.
Preparing to unpack .../kubernetes-cni_0.5.1-00_amd64.deb ...
Unpacking kubernetes-cni (0.5.1-00) ...
Selecting previously unselected package socat.
Preparing to unpack .../socat_1.7.3.1-1_amd64.deb ...
Unpacking socat (1.7.3.1-1) ...
Selecting previously unselected package kubelet.
Preparing to unpack .../kubelet_1.7.3-01_amd64.deb ...
Unpacking kubelet (1.7.3-01) ...
Selecting previously unselected package kubectl.
Preparing to unpack .../kubectl_1.7.3-01_amd64.deb ...
Unpacking kubectl (1.7.3-01) ...
Selecting previously unselected package kubeadm.
Preparing to unpack .../kubeadm_1.7.3-01_amd64.deb ...
Unpacking kubeadm (1.7.3-01) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up ebtables (2.0.10.4-3.4ubuntu2) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Setting up kubernetes-cni (0.5.1-00) ...
Setting up socat (1.7.3.1-1) ...
Setting up kubelet (1.7.3-01) ...
Setting up kubectl (1.7.3-01) ...
Setting up kubeadm (1.7.3-01) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
root#ubuntu-512mb-nyc3-01:~# kubeadm init
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[init] Using Kubernetes version: v1.7.3
[init] Using Authorization modes: [Node RBAC]
[preflight] Running pre-flight checks
[preflight] WARNING: docker version is greater than the most recently validated version. Docker version: 17.06.0-ce. Max validated version: 1.12
[kubeadm] WARNING: starting in 1.8, tokens expire after 24 hours by default (if you require a non-expiring token use --token-ttl 0)
[certificates] Generated CA certificate and key.
[certificates] Generated API server certificate and key.
[certificates] API Server serving cert is signed for DNS names [ubuntu-512mb-nyc3-01 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 165.227.70.168]
[certificates] Generated API server kubelet client certificate and key.
[certificates] Generated service account token signing key and public key.
[certificates] Generated front-proxy CA certificate and key.
[certificates] Generated front-proxy client certificate and key.
[certificates] Valid certificates and keys now exist in "/etc/kubernetes/pki"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/controller-manager.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/scheduler.conf"
[apiclient] Created API client, waiting for the control plane to become ready
^C
Here's the log from journalctl: https://pastebin.com/S6Tkak3P
How long did you wait for it to be ready? Note that it takes a bit in that step. Moreover, in the journalctl logs there are errors regarding the cni network not being ready, which is something expected. Could you try again and waiting a bit longer?

Mongodb installation on Docker

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)?