Try installing mongodb-client/server with -y to apt-get.