Mongodb update error



I have been using mongodb on c9 for around 4 months with no issues however whilst following along on a course, it suggested i update to latest mongodb 3.6 as my current version was only 2.6.
So i followed this guide (Updating Mongodb) and then reinstalled from most up to date version.
My data was still old and therefore not compatible. It was nothing important so i just deleted the data directory.

However i have since tried to reinstall etc but am now getting the below error at the end of the install code:

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:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Im not sure if this additional info will help but mongo --version tells me i have latest version installed and when i type ‘mongo’ to command, the following occurs:

MongoDB shell version v3.6.2
connecting to: mongodb://
2018-01-31T18:02:21.757+0000 W NETWORK [thread1] Failed to connect to, in(checking socket for error after poll), reason: Connection refused
2018-01-31T18:02:21.785+0000 E QUERY [thread1] Error: couldn’t connect to server, connection attempt failed :
exception: connect failed

Can anyone assist?



Hi nissacjg,

Did you find the solution for that?

I am facing the same very issue but can’t find anything sound in these community forums.

Would much appreciate any feedback!



Hi Alexey,

Unfortunately I did not find a solution so I ended up creating a new workspace and transferring my files to the new workspace and all worked fine.

However, I believe I noticed something when creating and installing on the new work space…however it was such a long time ago I cannot remember :frowning:

I will try and have a look over it and if i remember or find any info, i will let you know!

Sorry I couldnt be more help!



Hi Gareth,

Many thanks for your prompt response.

I dig stackoverflow a bit yesterday. There are couple of similar issues reported and some responses suggest that it might be a release fault that doesn’t include the init script called “mongod” (& all errors are the outcome of this). If that would be a case, however, all people would encounter this problem not just some fraction… I don’t know…

Anyway, I found a mongod init script on a GitHub (; then I created empty mongod file ($ touch /etc/init.d/mongod); then I opened this file (nano /etc/init.d/mongod) and copied the script from GitHub there then saved in MS DOS format and closed. Then ran installation command again… For good or bad sake those errors disappeared.