gpg: no valid OpenPGP data found
UbuntuJenkinsJenkins PluginsUbuntu 13.10Ubuntu Problem Overview
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 -
Ubuntu Solutions
Solution 1 - Ubuntu
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.
Solution 2 - Ubuntu
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
Solution 3 - Ubuntu
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
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key
sudo apt-key add jenkins-ci.org.key
Solution 4 - Ubuntu
> 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
.
Solution 5 - Ubuntu
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/"
Solution 6 - Ubuntu
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 :)
Solution 7 - Ubuntu
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 -
Solution 8 - Ubuntu
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.
Solution 9 - Ubuntu
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.
Solution 10 - Ubuntu
export https_proxy=http://user:pswd@host:port
^^^^
Use http
for https_proxy instead of https
Solution 11 - Ubuntu
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 -
Solution 12 - Ubuntu
install gpg and
1-Import the repository’s GPG key:
wget -qO - https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
2-this is code repository elasticserach in linux for download
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
3-link download elasticsearch
https://www.elastic.co/downloads/elasticsearch
if error "Job for elasticsearch.service failed because a timeout was exceeded. See "systemctl status elasticsearch.service" and "journalctl -xe" for details."
solution:
1-sudo journalctl -f
2-sudo systemctl enable elasticsearch.service
3-sudo systemctl start elasticsearch
Solution 13 - Ubuntu
I guess the issue is with wrong GPG key. Jenkins changed their GPG key recently (16 April 2020). You might need to import the correct key following the current official directions.
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
Solution 14 - Ubuntu
Try executing the commands separately.
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc
then
sudo apt-key add -
Solution 15 - Ubuntu
wget
may not be using up to date root certificates. In that case it will output nothing to stdout, causing apt-key
to throw the error of the description. I could resolve this by upgrading my debian 9.5 image to the latest 9.13
apt-get update
apt-get upgrade -y
before running wget
Solution 16 - Ubuntu
There's another, very basic reason that triggers the error message that is the title of this post:
This error message happens if you try to decrypt an unencrypted file.
The message is saying that gpg did try to read the file to decrypt, but it could not find the info it needed, the info the encrypt process writes there.
So the message can also mean "double-check you gave the correct file to decrypt, it looks like it is not an encrypted file".
Like this:
# Encrypt your file
encrypt my_text_file > my_encrypted_file
# ERROR! You try to decrypt the unencrypted file DON'T DO THIS
decrypt my_text_file > decrypted_file
gpg: no valid OpenPGP data found.
gpg: decrypt_message failed: Unknown system error
# You unencrypt the correct (encrypted) file and it works
decrypt my_encrypted_file > decrypted_file
Solution 17 - Ubuntu
I also got the same error. I've referred to the below mentioned link and ran this commands
https://stackoverflow.com/questions/18967942/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