“The following packages have been kept back” ?

We might see this during a “apt-get upgrade” command on Ubuntu:

Calculating upgrade... Done
The following packages have been kept back:
  linux-cloud-tools-virtual linux-generic linux-headers-generic 
  linux-image-generic linux-signed-generic linux-signed-image-generic
  mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

According to [this article]:

There we can see packages haven’t been upgraded, even though newer packages are available. This is because two new packages were introduced, and these upgrades depend upon it.

To upgrade it, and you’re ABSOLUTELY SURE that you want to install the new introduced packages:

apt-get dist-upgrade

The following message will appear and you’re good to go:

The following NEW packages will be installed:
  libevent-core-2.0-5 linux-cloud-tools-4.4.0-38 linux-cloud-tools-4.4.0-38-generic linux-headers-4.4.0-38 linux-headers-4.4.0-38-generic
  linux-image-4.4.0-38-generic linux-image-extra-4.4.0-38-generic linux-signed-image-4.4.0-38-generic
The following packages will be upgraded:
  linux-cloud-tools-virtual linux-generic linux-headers-generic linux-image-generic linux-signed-generic linux-signed-image-generic
  mysql-server-5.7 mysql-server-core-5.7
8 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.

Note that this command may also remove your existing packages while upgrading – which means there are possibilities your system could be messed up.

Autostart/Upstart Mongodb on Ubuntu 16.04 Xenial Xerus


Check for Mongodb systemctl status by:

sudo systemctl status mongod

Enable the Mongodb Autostart/upstart with system start up:

sudo systemctl enable mongod

Note: if both of the commands returning a service not found message, then check if the service entry exist in either




If not then refer to Mongodb Documentation to create the systemd service file for Ubuntu 16.04 at this path:


With this content:

Description=High-performance, schema-free document-oriented database
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf

And go back to the start of this article.

Smartthings SmartApp send downstream cloud message with Google Firebase


  1. Follow instruction at Smartthings to create and configure the SmartApp.
  2. Follow the document to subscribe the things event. An example at github shows a sample code snippet of a working SmartApp – provides a HTTP GET API interface to list all the available things and the data.
  3. Also, follow the Firebase document to setup the client device SDK and note down the client device token, and the firebase server key.
  4. Write an event data handler to process the event and send downstream message by http POST. Sample code can be seen below.

Node.js send downstream cloud message with Google Firebase

Here is an instruction of using Node.js to send JSON data payload to a client device with Google Firebase Cloud Message service.


  1. Setup and Configure Google Firebase on the client device (Android, iOS). An Android sample of integration of Firebase core and message can be found here. Locate and note the client device token, and the firebase server key.
  2. On Node.js server side, sending downstream message to Firebase API with NPM package “request“. Sample code can be seen below.
  3. Detail information is documented here (downstream message) and here (Message description)  at Firebase website.

Setup C++ Development Environment for MangoDB Client

The primary target for this article is to install the mongodb C++ driver for development with C++ projects.

There is a newer branch C++ 11 based driver at this point but it’s better to start with the stable legacy one.

In a normal fresh Linux system the following steps has to be go through to meet the driver building prerequisites. For a full instruction please refer to “https://github.com/mongodb/mongo-cxx-driver/wiki/Download-and-Compile-the-Legacy-Driver“.

Download and build/install Boost (Boost.org or Official Guide)

Driver require a boost version >= 1.49

tar -xzvf ./boost_1_xx_x.tar.gz
cd ./boost_1_xx_x/
sudo ./b2 install

Install Python if needed (Python.org)

Driver require a Python version > 2.0

Download and install Scons (Scons.org)

Install by RPM package or build from source.

rpm -uvh scons-x.x.x-x.noarch.rpm

Git is also needed to clone the mongo-cxx-driver

sudo yum install git


sudo apt-get install git

Git Official Guide

Build and Install the MongoDB C++ Driver

git clone git@github.com:mongodb/mongo-cxx-driver.git
cd ./mongo-cxx-driver
git checkout legacy
sudo scons install

Important: After this step the include and lib were generated but NOT locate in proper location. Use a prefix option to build and install or move everything under /mongo-cxx-driver/build/install/ into /usr/local/

mv ./build/install/* /usr/local/

Time to build and test a sample program

Check if you have $LD_LIBRARY_PATH in valid value by


And if nothing is showed go export the lib path by

export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH

Build the test program with

g++ tutorial.cpp -pthread -lmongoclient -lboost_thread -lboost_system -lboost_regex -o tutorial

Here is a great example to connect and insert into MongoDB: https://gist.github.com/brandondiamond/1528272. Note that a initialize() has to be added into the source to avoid a coredump.

int main() {

All set!

Everything is verified with:

  • Boost_1_55_0
  • Scons-2.3.5-1.noarh.rpm
  • Mongo-cxx-driver branch legacy