Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing PostgreSQL 9.4: "gpg: no valid OpenPGP data found"

I'm trying to install PostgreSQL 9.4 on a clean, new Debian Jessie machine.

I'm following these instructions: https://wiki.postgresql.org/wiki/Apt#Quickstart

When I get to this point:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -

I get this error:

gpg: no valid OpenPGP data found.

What am I doing wrong?

like image 251
Richard Avatar asked Aug 13 '15 15:08

Richard


People also ask

How do I fix no valid OpenPGP data found?

The “gpg: no valid OpenPGP data found” error occurs due to certification issues regarding the software that is to be installed using wget or curl.It can be fixed by removing the certification check in the command line.

What is OpenPGP data?

openpgp.org. PGP and similar software follow the OpenPGP, an open standard of PGP encryption software, standard (RFC 4880) for encrypting and decrypting data.


2 Answers

These instructions are fine, you must suffer from connection problems (or get other contents served than expected. Do following:

  • Run wget -o - https://www.postgresql.org/media/keys/ACCC4CF8.asc (without --quiet and without pipe to GnuPG) to inspect what's actually happening. Is wget indicating any connection problems?
  • You can also download the file from your browsers, simply store the textual contents using copy-paste to a text file and import it using apt-key add [path-to-file] (or, given somebody finding this question wants to import to the default GnuPG keyring, gpg --import < [path-to-file]).

Most likely wget does not find the root certificated referenced by the PostgreSQL website, you're behind some proxy which is not configured for wget or a gateway changing the website; at least the results returned are not key data in a format GnuPG expects.

like image 161
Jens Erat Avatar answered Sep 20 '22 15:09

Jens Erat


In my case the problem was caused by an incorrect https certificate from postgresql.

Just add the --no-check-certificate to the wget command.

like image 29
Ektor Avatar answered Sep 18 '22 15:09

Ektor