6
votes

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?

2
Split that command and verify what you're getting is the actual key and not some connection error. - Jakub Kania
Side note: Debian Jessie already ships PostgreSQL 9.4, do you really need to build on your own? Testing/unstable usually ship very bleeding edge versions, these might be a better way to go instead of building on your own (updates included). - Jens Erat
@JensErat thanks. I ended up just using apt to install it, much easier! - Richard
yep but in Jessie you have 9.4 (and magnificiant JSONB type so you can apt-get remove mongodb !), but still miss 9.5 (and it's more than welcome UPSERT capabilities !) - comte

2 Answers

2
votes

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.

1
votes

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

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