Linux installation of mongod after updating mongo

Hi all, I hope someone can help. I previously had mongo and mongod versions 3.6.x installed. When I set up the Atlas free tier and tried to connect, I had a failure with SSL, I believe. So, I installed the latest version of the mongo shell (4.0.3). I tried to connect again, but since my mongo server was still at 3.6.x, I received an error. So, I then tried to install the mongo server. When I go to check the version of mongod, I get the error:

$ mongod --version
mongod: error while loading shared libraries: cannot open shared object file: No such file or directory

So, I will dig into the potential issue of not having the right symlink set up, but this is pretty new stuff for me. I am running Ubuntu 18.04, I believe. Any help to rectify this so that I can get up and running would be fantastic. I might have made a mess when trying to get everything installed in the first place.

All the best,

Hi Christopher_07166,

You just need to create a symbolic link which directs it to the latest version you have installed just now.

Please check the steps:

Create a symbolic link for the mongod server and check the version.

sudo ln -s ~/Downloads/mongodb-correct-version/bin/mongod /usr/local/sbin/bin/mongod
mongod --version
Now create a symbolic link for the shell and check the version.

sudo ln -s ~/Downloads/mongodb-correct-version/bin/mongo /usr/local/bin/mongo
mongo --version
Create a directory path for the server.

mkdir ~/data
mkdir ~/data/db
Start the server and let it run from a separate terminal than the shell.

mongod --dbpath ~/data/db/
It should be listening on port 27017. In a new terminal, start mongo.


If it is a SSL problem, then try these steps:

sudo apt-get update
sudo apt-get install libssl1.0.0 libssl-dev
Now lets fix the naming of the file by creating a link:

cd /lib/x86_64-linux-gnu
sudo ln -s
sudo ln -s


If it doesn’t work, let me know!


Thank you very much Kanika! I’ll attempt these steps later today. I appreciate the quick response.


1 Like

I just wanted to update that the issue, at least for getting mongod dependencies all set was to install libcurl4. Fairly straightforward:

$ sudo apt-get install libcurl4

When I ran mongod --version again, it worked.

I am still having problems connecting, it is an authorization failure, so I am going to look into some of the other messages. I did follow the softlink instructions for libssl and libcrypto.


1 Like

Just as a final message: I was under the impression that we would be using the username m001-student and password m001-mongodb-basics for our own cluster as well, as if it were some default setting. That was why I was getting an authentication failure. Unless I am supposed to use the above username and password, I will consider this a completely resolved issue.

To sum up the two issues:

I was getting an error for mongod that I was missing, which I gather is a symbolic link to connect the server application to its required libraries (still unsure), the required library package being libcurl4. The fix was installing libcurl4. I had other libcurl links in /lib/x86_64-linux-gnu (,,

I was unable to authenticate the m001-student account in my own Atlas cluster. It seemed as if I was supposed to be able (and should) connect to my cluster using the code snippet provided by my cluster, and changing MY username and MY password with the default username and password for the shared class cluster. The fix was to use my own account name and password that I set up in Atlas.

Thank you for your time, and I hope this is useful for someone else in the future.


1 Like