[ubuntu] gpg: no valid OpenPGP data found

I am trying to install Jenkins on Ubuntu 13.10 and I am getting the above mentioned error when i try to run the following command:

wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -

This question is related to ubuntu jenkins jenkins-plugins ubuntu-13.10

The answer is


export https_proxy=http://user:pswd@host:port
                   ^^^^

Use http for https_proxy instead of https


I got this error in an Ubuntu Docker container. I believe the cause was that the container was missing CA certs. To fix it, I had to run:

apt-get update
apt-get install ca-certificates

I had a similar issue.

The command I used was as follows:

wget -qO https://download.jitsi.org/jitsi-key.gpg.key |  apt-key add -

I forgot a hyphen between the flags and the URL, which is why wget threw an error.

This is the command that finally worked for me:

wget -qO - https://download.jitsi.org/jitsi-key.gpg.key |  apt-key add -

I too got the same error, when I did this behind a proxy. But after I exported the following from a terminal and re-tried the same command, the problem got resolved:

export http_proxy="http://username:password@proxy_ip_addr:port/"
export https_proxy="https://username:password@proxy_ip_addr:port/"

Managed to resolve it. separated the command in to two commands and used directly the file name which was downloaded example -

wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key    add -

can be separated into

  1. wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key
  2. sudo apt-key add jenkins-ci.org.key

gpg: no valid OpenPGP data found.

In this scenario, the message is a cryptic way of telling you that the download failed. Piping these two steps together is nice when it works, but it kind of breaks the error reporting -- especially when you use wget -q (or curl -s), because these suppress error messages from the download step.

There could be any number of reasons for the download failure. My case, which wasn't exactly listed so far, was that the proxy settings were lost when I called the enclosing script with sudo.


you forgot sudo ... try with sudo and you will get OK

sudo wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -

In my case, the problem turned out to be that the keyfile was behind a 301 Moved Permanently redirect, which the curl command failed to follow. I fixed it by using wget instead:

wget URL
sudo apt-key add FILENAME

...where FILENAME is the file name that wget outputs after it downloads the file.

Update: Alternatively, you can use curl -L to make curl follow redirects.


i got this problem "gpg-no-valid-openpgp-data-found" and solve it with the following first i open browser and paste https://pkg.jenkins.io/debian/jenkins-ci.org.key then i download the key in Downloads folder then cd /Downloads/ then sudo apt-key add jenkins-ci.org.key if Appear "OK" then you success to add the key :)


By executing the following command, it will save a jenkins-ci.org.key file in the current working directory:

curl -O http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key

Then use the following command to add the key file:

apt-key add jenkins-ci.org.key

If the system returns OK, then the key file has been successfully added.


I also got the same error. I've referred to the below mentioned link and ran this commands

gpg --import fails with no valid OpenPGP data found

gpg --import KEYS
sudo apt-get update

It worked.

I'm using Ubuntu version 12.04


This problem might occur if you are behind corporate proxy and corporation uses its own certificate. Just add "--no-check-certificate" in the command. e.g. wget --no-check-certificate -qO - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -

It works. If you want to see what is going on, you can use verbose command instead of quiet before adding "--no-check-certificate" option. e.g. wget -vO - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - This will tell you to use "--no-check-certificate" if you are behind proxy.


Examples related to ubuntu

grep's at sign caught as whitespace "E: Unable to locate package python-pip" on Ubuntu 18.04 How to Install pip for python 3.7 on Ubuntu 18? "Repository does not have a release file" error ping: google.com: Temporary failure in name resolution How to install JDK 11 under Ubuntu? How to upgrade Python version to 3.7? Issue in installing php7.2-mcrypt Install Qt on Ubuntu Failed to start mongod.service: Unit mongod.service not found

Examples related to jenkins

Maven dependencies are failing with a 501 error Jenkins pipeline how to change to another folder Docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock groovy.lang.MissingPropertyException: No such property: jenkins for class: groovy.lang.Binding How to solve npm install throwing fsevents warning on non-MAC OS? Run bash command on jenkins pipeline Try-catch block in Jenkins pipeline script How to print a Groovy variable in Jenkins? Jenkins pipeline if else not working Error "The input device is not a TTY"

Examples related to jenkins-plugins

How to set and reference a variable in a Jenkinsfile Jenkins: Is there any way to cleanup Jenkins workspace? How to get build time stamp from Jenkins build variables? gpg: no valid OpenPGP data found How to install a plugin in Jenkins manually Execute Shell Script after post build in Jenkins Jenkins CI: How to trigger builds on SVN commit How to get a list of installed Jenkins plugins with name and version pair In Jenkins, how to checkout a project into a specific directory (using GIT)

Examples related to ubuntu-13.10

gpg: no valid OpenPGP data found