Fix gpg: no valid OpenPGP data found error in Ubuntu



Fix gpg: no valid OpenPGP data found error in Ubuntu

Today I was installing Postgres 9.6 in Ubuntu 14 server and while adding the key, I got this error.

gpg: no valid OpenPGP data found error

This is the command I entered:

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

I tried several solutions and found a way to get past this error. To solve, all you have to do is download the key separately and add it.

Here we basically the run the above in two seperate commands. This is how to do it.

First get the key.

wget https://www.postgresql.org/media/keys/ACCC4CF8.asc

Then add it:

sudo apt-key add ACCC4CF8.asc

That's it. Hope it will help someone ;)

3 comments :

  1. Replies
    1. This comment has been removed by the author.

      Delete
    2. Use --no-check-certificate on wget

      wget --no-check-certificate -q -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

      Delete