The public key is not available: NO_PUBKEY 68818C72E52529D4

After adding a mongodb you may experience an error about the GPG PUB KEY like teh following.

W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/testing Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 68818C72E52529D4
E: The repository ‘http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/testing Release’ is not signed.

You can fix this issue by adding the PUB KEY for MongoDB’s repository.

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68818C72E52529D4

Try update again

apt update

Meteor Remote MongoDB

I don’t like to use big repeating command and I was searching for a solution where I will be setting a variable embedded with something so every time I start my meteor app; the MONGO_URL will set to environment automatically. So this what I did:

In the package.json file I replaced the start parameter as below:

"scripts": {
    "start": "MONGO_URL=mongodb://username:password@host_url:portnumber/dbname meteor run"
  },

 

Credits: https://stackoverflow.com/questions/38713003/how-to-connect-to-external-mongodb-instance-in-meteor

Connect to a remote Mongodb instance with local meteor instance

Great for development. Say you want to share the database with someone else in a remote location.

  • Create a package.json file with npm init, if you don’t have one already.

  • Enter and modify the following line in that file (replacing all the <...>‘s):

"scripts": {
"meteor": "MONGO_URL=mongodb://<USER>:<PASSWORD>@<SERVER>:<PORT>/<DB> meteor"
}

For meteor to start using your remote MongoDB start meteor with 

 

npm run meteor

 

https://stackoverflow.com/questions/10588038/how-to-use-the-existing-mongodb-in-a-meteor-project