Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was installing mongo DB on my Ubuntu-12.04 system, but while i give the following command in my terminal

apt-key adv --keyserver --recv 7F0CEB10

It gives me the following error

gpg: requesting key 7F0CEB10 from hkp server
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error

Is there any other way of installing mongo db or what can be done to avoid the above situation?

share|improve this question
up vote 5 down vote accepted

The command that is failing is the one that installs the key that is used to sign the MongoDB packages, so that apt-get can determine whether the packages are genuine.

You could try skipping installation of the key and adding --allow-unauthenticated when you run apt-get to install the packages. See How do I bypass/ignore the gpg signature checks of apt? for more detail.

But ideally, you need to figure out why you cannot connect to the key server to install the key.

Firstly, you can check your Internet connection and DNS by visiting in a browser. If your Internet connection is working you will see a simple page entitled SKS OpenPGP Public Key Server. This shows that your computer can look up and connect to the key server.

If this is the case, then it is likely that the problem is a firewall or proxy server restricting your access to the specific port that apt-key wants to connect to. See No gpg key from behind a firewall for details for how to allow apt-key to connect via a proxy server.

share|improve this answer

The problem was with proxy, blocking connection to keyserver, add http-proxy details in the apt-key command itself.

sudo apt-key adv --keyserver hkp:// --keyserver-options http-proxy=http://username:password@proxy:port --recv-keys KEYID
share|improve this answer

I have also mongodb installed in my system and I take the help from this site

And it always works.

share|improve this answer

Try this command

sudo apt-key adv --keyserver --recv 7F0CEB10

otherwise use this package to install instead

share|improve this answer

Simple Mongo Setup on AWS Unbuntu 14.0

sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10

echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

sudo apt-get update
sudo apt-get install -y mongodb-org
sudo apt-get install php5
sudo apt-get install apache2
sudo apt-get install libsasl2-dev
sudo apt-get install php-pear php5-dev
sudo pecl install mongo

Add the lines below in /etc/php5/apache2/php.ini:

extension_dir = "/usr/lib/php5/20121212"

Then restart apache:

sudo service apache2 restart

Create a php file in /var/www/html, with these contents:


Run the file in a browser and find the Extension "Mongo".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.