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 -

Philipp Kyeck's user avatar

Philipp Kyeck

18.2k15 gold badges84 silver badges121 bronze badges

asked Jan 24, 2014 at 17:26

dummy's user avatar

2

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.

Louis Lac's user avatar

Louis Lac

4,9911 gold badge19 silver badges36 bronze badges

answered Jun 26, 2016 at 15:09

Lake's user avatar

LakeLake

1,3771 gold badge8 silver badges4 bronze badges

5

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

answered Feb 18, 2018 at 16:46

Yevgeniy Brikman's user avatar

Yevgeniy BrikmanYevgeniy Brikman

8,5815 gold badges44 silver badges60 bronze badges

3

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

Kevin Burke's user avatar

Kevin Burke

60.1k76 gold badges186 silver badges302 bronze badges

answered Sep 23, 2016 at 6:52

Zia's user avatar

ZiaZia

2,3352 gold badges17 silver badges14 bronze badges

3

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.

answered Jan 24, 2019 at 18:53

Brent Bradburn's user avatar

Brent BradburnBrent Bradburn

50.9k17 gold badges151 silver badges171 bronze badges

2

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/"

answered Mar 9, 2015 at 6:29

Aananth C N's user avatar

Aananth C NAananth C N

4287 silver badges14 bronze badges

2

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 :)

answered Aug 3, 2017 at 9:27

Hesham Magdy's user avatar

0

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 -

answered May 7, 2020 at 1:24

MoralJustice's user avatar

1

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.

answered Feb 17, 2018 at 23:12

Soren Bjornstad's user avatar

Soren BjornstadSoren Bjornstad

1,2321 gold badge14 silver badges24 bronze badges

1

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 -

answered Mar 18, 2020 at 1:01

Igor Radovanovic's user avatar

2

Try executing the commands separately.

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

then

sudo apt-key add -

answered Oct 10, 2021 at 15:23

Milind's user avatar

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.

answered Jul 17, 2018 at 23:12

Ryan Yuan's user avatar

Ryan YuanRyan Yuan

2,3462 gold badges13 silver badges23 bronze badges

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

Use http for https_proxy instead of https

answered Nov 11, 2019 at 9:19

lonsty's user avatar

lonstylonsty

1851 silver badge10 bronze badges

1

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

answered Mar 15, 2021 at 12:02

Netwons's user avatar

NetwonsNetwons

1,05211 silver badges14 bronze badges

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 -

answered Sep 19, 2021 at 17:24

Tapan Hegde's user avatar

Tapan HegdeTapan Hegde

1,2221 gold badge8 silver badges25 bronze badges

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

answered Sep 30, 2021 at 22:51

AlejandroVD's user avatar

AlejandroVDAlejandroVD

1,54618 silver badges22 bronze badges

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

answered Jan 10, 2022 at 17:27

CyclingDave's user avatar

CyclingDaveCyclingDave

1,0781 gold badge10 silver badges22 bronze badges

I have solved the error gpg: no valid OpenPGP data found. For my Ubuntu 20.04
Firstly:

sudo apt-get update

then,

sudo apt-get install ca-certificates

Finally,

sudo apt install curl

answered Sep 23, 2022 at 4:03

Azharul Islam Somon's user avatar

For those facing gpg: no valid OpenPGP data found. during docker installation due to curl: (5) Could not resolve proxy: could clear their list of proxies and try again;

env | grep -i proxy  //for listing all proxies
unset <name of the proxy>  // remove all proxies that is shown in the error 

Example :

unset http_proxy
unset HTTPS_PROXY

answered Oct 21, 2022 at 7:31

Harry_Verman's user avatar

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

Community's user avatar

answered Feb 24, 2014 at 12:21

DheerajG's user avatar

DheerajGDheerajG

972 silver badges7 bronze badges

3

Installing any software differs a lot to behave on Linux and Windows. In Ubuntu, a simple apt install command can retrieve various software and install it onto the system. However, the apt install does not always do the job and third-party installers must be used to get software onto your system. For this, you may require wget and curl utilities. But making use of these utilities can oftentimes cause the “gpg: no valid OpenPGP data found” error.

This article will provide the reasons for the error “gpg: no valid OpenPGP data found” and what can be done to fix this issue.

A few different reasons exist which can cause this error to pop up on a system while trying to use the features of wget or curl. This post discusses a lot of common causes behind this issue.

Reason 1: No Certification

The corporation certificates are the common reason that invokes this error. Sometimes the company that develops the software will have its own certification which will be enabled by default and hence this error will be invoked. When this happens, the error shown in the snippet below will occur:

Solution 1: Remove the Certification Check

If any software has its own certification, it can easily be removed during the command line execution. Let’s take a sample command for this scenario. This code which is demonstrated below, is used to download a file that contains keys using the wget command.

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

To remove the certification from this software, use the following flag in the abovementioned command:

--no-check-certificate

After adding the flag, the command looked like as:

wget --no-check-certificate -qO - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -

Solution 2: Install certificates

Aside from removing the certification, the other solution is to install the CA certificates onto your system. This is a tool that helps store and generate certificates. Its installation can be achieved by executing the code that is shown below:

$ sudo apt update
$ sudo apt install ca-certificates

If the certificates are already installed, the following message will appear on your terminal:

Reason 2: Wrong Path for Certificates

Sometimes the error is invoked when the computer is looking for the CA certification in the wrong path. The curl command is unable to locate the correct root CA path. Let’s see how it can be fixed:

Solution: Change the Path in the .bashrc File

The bashrc is a type of executable script file. The first step to changing the path in the bashrc is to open up the file itself. To achieve this, execute the following command which will prompt the .bashrc file to open:

$ nano ~/.bashrc

The file should look something like the one shown below once it has been opened up:

The next step is to add the path to this file. Add the command shown below into the file and save and exit it:

export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt

Once the command has been added to the file, the error should no longer occur and the command will run.

Conclusion

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. Moreover, ensure that the latest version of the CA certificates is installed on the system at the correct path. This post has demonstrated the methods to fix the error “gpg: no valid OpenPGP data found”.

Introduction

If you are a developer who uses GPG encryption to secure your data and communications, you may have encountered the error message «gpg: no valid openpgp data found.» This error can occur when you try to decrypt a file or message that has been encrypted with GPG. In this guide, we will walk you through the steps to troubleshoot and fix this error.

Prerequisites

Before we begin, make sure you have the following installed on your system:

  • GPG (GNU Privacy Guard)
  • The public key of the person who encrypted the file or message you are trying to decrypt

Step-by-Step Solution

Here are the steps you can follow to fix the «gpg: no valid openpgp data found.» error:

Check that the file or message you are trying to decrypt is in the correct format. GPG only works with files or messages that have been encrypted with OpenPGP format. You can check the format of the file by running the following command:

file <file_name>

Replace <file_name> with the name of the file you are trying to decrypt. The output should show «OpenPGP encrypted data.»

Check that you have imported the public key of the person who encrypted the file or message. You can import the key by running the following command:

gpg --import <public_key_file>

Replace <public_key_file> with the path to the public key file. If you don’t have the public key file, you can ask the person who encrypted the file or message to send it to you.

Verify that the public key has been imported correctly by running the following command:

gpg --list-keys

This command should list all the public keys that have been imported into your GPG keyring.

Check that the file or message has not been tampered with. You can do this by verifying the signature of the file or message with the public key of the person who encrypted it. Run the following command:

gpg --verify <file_name>

Replace <file_name> with the name of the file you are trying to decrypt. The output should show «Good signature.»

If none of the above steps work, try using a different tool to decrypt the file or message. GPG is not the only tool that can decrypt OpenPGP encrypted data. There are several alternatives, such as OpenPGP.js, that you can try.

FAQ

Q1. What is GPG?

GPG (GNU Privacy Guard) is a free and open-source software tool that provides encryption and digital signature capabilities for data and communications.

Q2. What is OpenPGP?

OpenPGP is a standard that defines a format for encrypted and signed messages and files. GPG is one of the tools that implements this standard.

Q3. What is a public key?

A public key is a cryptographic key that can be freely distributed and used to encrypt data or verify digital signatures. It is the counterpart to a private key, which is kept secret and used to decrypt data or create digital signatures.

Q4. What is a GPG keyring?

A GPG keyring is a collection of public and private keys that GPG uses to encrypt and decrypt data and create and verify digital signatures.

Q5. What should I do if I can’t import a public key?

If you can’t import a public key, it may be because the key has been revoked or expired. You should contact the person who sent you the key to get an updated or valid key.

  • GNU Privacy Guard
  • OpenPGP Standard
  • OpenPGP.js

Remove the Ethereum repository first:

sudo add-apt-repository --remove ppa:ethereum/ethereum
sudo apt update

Remove imported GPG key:

sudo apt-key del 2A518C819BE37D2C2031944D1C52189C923F6CA9

Import GPG key of the Ethereum repo again:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2A518C819BE37D2C2031944D1C52189C923F6CA9

Add repository again:

sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt update

UPDATE

Remove the Ethereum repository again:

sudo add-apt-repository --remove ppa:ethereum/ethereum
sudo apt update

Remove imported GPG key:

sudo apt-key del 2A518C819BE37D2C2031944D1C52189C923F6CA9

Try

gpg --keyserver keyserver.ubuntu.com --recv-keys 2a518c819be37d2c2031944d1c52189c923f6ca9

and next

gpg --export --armor 2a518c819be37d2c2031944d1c52189c923f6ca9 | sudo apt-key add -

Add repository for Ubuntu 16.04:

echo -e "deb http://ppa.launchpad.net/ethereum/ethereum/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/ethereum-ubuntu-ethereum-xenial.list

Update apt:

sudo apt update

Install software you want from the Ethereum repository.

I’m trying to follow the installation instructions for Debian provided on Docker website. Unfortunately adding a GPG key fails for me:

$ curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
gpg: WARNING: nothing exported
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

I’ve tried to download the key and add it from the local file system, but the effect is the same:

$ apt-key add docker.gpg 
gpg: WARNING: nothing exported
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

The same happens for other keys, e.g. VirtualBox:

$ apt-key add oracle_vbox_2016.asc 
gpg: WARNING: nothing exported
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

The keys looks fine:

$ cat docker.gpg 

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFit2ioBEADhWpZ8/wvZ6hUTiXOwQHXMAlaFHcPH9hAtr4F1y2+OYdbtMuth
lqqwp028AqyY+PRfVMtSYMbjuQuu5byyKR01BbqYhuS3jtqQmljZ/bJvXqnmiVXh
[...]
jCxcpDzNmXpWQHEtHU7649OXHP7UeNST1mCUCH5qdank0V1iejF6/CfTFU4MfcrG
YT90qFF93M3v01BbxP+EIY2/9tiIPbrd
=0YYhg
-----END PGP PUBLIC KEY BLOCK-----

$ shasum docker.gpg 
f5b5bd1487cefc0c53c947e11ca202e86b33dbad  docker.gpg

$ gpg --list-packets docker.gpg 
# off=0 ctb=99 tag=6 hlen=3 plen=525
:public key packet:
    version 4, algo 1, created 1487788586, expires 0
    pkey[0]: [4096 bits]
    pkey[1]: [17 bits]
    keyid: 8D81803C0EBFCD88
# off=528 ctb=b4 tag=13 hlen=2 plen=43
:user ID packet: "Docker Release (CE deb) <docker@docker.com>"
# off=573 ctb=89 tag=2 hlen=3 plen=567
:signature packet: algo 1, keyid 8D81803C0EBFCD88
    version 4, created 1487792064, md5len 0, sigclass 0x13
    digest algo 10, begin of digest b2 c9
    hashed subpkt 2 len 4 (sig created 2017-02-22)
    hashed subpkt 27 len 1 (key flags: 2F)
    hashed subpkt 11 len 4 (pref-sym-algos: 9 8 7 3)
    hashed subpkt 21 len 4 (pref-hash-algos: 10 9 8 11)
    hashed subpkt 22 len 4 (pref-zip-algos: 2 3 1 0)
    hashed subpkt 30 len 1 (features: 01)
    hashed subpkt 23 len 1 (keyserver preferences: 80)
    subpkt 16 len 8 (issuer key ID 8D81803C0EBFCD88)
    data: [4094 bits]
# off=1143 ctb=b9 tag=14 hlen=3 plen=525
:public sub key packet:
    version 4, algo 1, created 1487788586, expires 0
    pkey[0]: [4096 bits]
    pkey[1]: [17 bits]
    keyid: 7EA0A9C3F273FCD8
# off=1671 ctb=89 tag=2 hlen=3 plen=1086
:signature packet: algo 1, keyid 8D81803C0EBFCD88
    version 4, created 1487788586, md5len 0, sigclass 0x18
    digest algo 8, begin of digest f2 b8
    hashed subpkt 2 len 4 (sig created 2017-02-22)
    hashed subpkt 27 len 1 (key flags: 02)
    subpkt 16 len 8 (issuer key ID 8D81803C0EBFCD88)
    subpkt 32 len 540 (signature: v4, class 0x19, algo 1, digest algo 8)
    data: [4095 bits]

Am I doing something wrong? What steps should I take to troubleshoot it further?

I’m on Debian Stretch. I don’t have any firewall. I’ve tried it on several networks.

Понравилась статья? Поделить с друзьями:
  • Резюме учителя дефектолога образец как правильно составить
  • Как хорошую тачку найти
  • Пропал айфон как найти если он отключен
  • Как исправить ошибку 0xc000005 в виндовс
  • Как составить график выхода на работу поваров пример