E: Unable to locate package mongodb-org

I am trying to install mongodb on ubuntu 14.04 and I am following the steps on docs.mongodb.org

But when I get to the step:

sudo apt-get install -y mongodb-org

I get the following error :

root@sabbir-pc:~# 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

And I get to the step:

sudo apt-get install -y mongodb-org=3.0.1 mongodb-org-server=3.0.1 mongodb-org-shell=3.0.1 mongodb-org-mongos=3.0.1 mongodb-org-tools=3.0.1

I found the following problem

root@sabbir-pc:~# sudo apt-get install -y mongodb-org=3.0.1 mongodb-org-server=3.0.1 mongodb-org-shell=3.0.1 mongodb-org-mongos=3.0.1 mongodb-org-tools=3.0.1
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

How can I solve this problem? I also follow stackoverflow link (same problem), but no result.


You need to add the PPA

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update

I had the same problem. I wrong to write the list file for mongo where we insert the mongodb repository within Ubuntu sources list.

I strongly suggest to rewrite the following commands (for 14.04):

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list

and:

sudo apt-get update

After that you will be able to install the latest mongodb version:

sudo apt-get install -y mongodb-org

All described in the MongoDB website: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/?_ga=1.85252765.529335644.1441475542#install-mongodb