24

I am trying to install mongodb on my Ubuntu 12.04 Desktop edition. Firstly I hope there isn't any issue w.r.t. installing mongodb on Ubuntu Desktop edition.

I am following the mongodb manual to install it on my Ubuntu machine. When I try to import the 10gen public GPG Key using the instructions (given in the manual), By

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

I get this response:

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.WsHkMVxFlM --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 7F0CEB10

gpg: requesting key 7F0CEB10 from hkp server keyserver.ubuntu.com

gpgkeys: key 7F0CEB10 not found on keyserver

gpg: no valid OpenPGP data found.

gpg: Total number processed: 0

Any help or hint in this regard is appreciated.

Thanks in advance.

ahmed hamdy
  • 5,096
  • 1
  • 47
  • 58
kausal_malladi
  • 1,542
  • 3
  • 14
  • 30
  • The command ( `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10` ) has worked for me. I am running Ubuntu 12.04 32-bit. – Ngure Nyaga Oct 28 '12 at 20:09
  • 1
    Even I am on Ubuntu 32-bit Desktop Edition but it still displays the same error message. Is there any chance that the network firewall is causing the issue? – kausal_malladi Oct 28 '12 at 20:17

4 Answers4

32

A way to go around firewalls: query over typical port (80):
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
Another problem you may have would be a network proxy. If you need to connect to the internet through proxy, export proxy settings to you bash configuration - add line with your proxy address (and if needed: username/password - without it's just http://proxyserver:port):
export http_proxy=http://username:password@proxyserver:port/
at the end of file /etc/bash.bashrc

mrówa
  • 5,671
  • 3
  • 27
  • 39
  • Awesome, this fixed my problem as well – krb686 Jul 01 '13 at 12:40
  • Although I wasn't trying to solve this particular problem, I was having issues with an `http_proxy` (set in environment variables) not being used by apt-key. I even tried `sudo -E` to make it consider environment, didn't work. What **did** work though was invoking apt-key with an additional switch: `--keyserver-options http-proxy=http://proxyaddress:80`, which worked immediately. – Chris Woods May 21 '14 at 10:10
  • The part that I was missing was using *hkp://* as the protocol when specifying port 80. If you use *http://*, it's not going to work. – stonecrusher Dec 01 '15 at 21:05
7

like answer of @aniket-thakur , You can add MongoDB public GPG Key Manually By copy The content of this Page into file 10gen-gpg-key.asc Then add file using apt-key add <file> commend line :

sudo apt-key add 10gen-gpg-key.asc 
Community
  • 1
  • 1
ahmed hamdy
  • 5,096
  • 1
  • 47
  • 58
4

The second approach mentioned in this link worked for me. Manually download the key and add it. The link provides step by step procedure to fix the error happening due to missing key.

PS: Above link goes to my personal blog that has detailed steps on how to do this and a couple of other things you can try out to fix this.

Aniket Thakur
  • 66,731
  • 38
  • 279
  • 289
0

I couldn’t find any key running:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 83FBA1751378B444

The solution to me was:

sudo launchpad-getkeys 

and the I could finally run "apt-get update"

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
Laura Liparulo
  • 2,849
  • 26
  • 27