# Failed to download metadata...Bad GPG Signature

**URL:** <https://forum.opensearch.org/t/failed-to-download-metadata-bad-gpg-signature/20037>\
**Category:** OpenSearch\
**Created:** [June 27, 2024, 2:10pm UTC](https://forum.opensearch.org/t/failed-to-download-metadata-bad-gpg-signature/20037 "2024-06-27T14:10:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cawFEHman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/cawfehman/32/5379_2.png) [@cawFEHman](https://forum.opensearch.org/u/cawFEHman)\
**Post date:** [June 27, 2024, 2:10pm UTC](https://forum.opensearch.org/t/failed-to-download-metadata-bad-gpg-signature/20037/1 "2024-06-27T14:10:05Z")

</div>

Trying to install Opensearch 2.15 and I’m getting the below error…

```auto
yum install opensearch
OpenSearch 2.x 1.6 kB/s | 498 B 00:00    
OpenSearch 2.x 53 kB/s | 4.2 kB 00:00    
OpenSearch 2.x 2.9 kB/s | 498 B 00:00    
Error: Failed to download metadata for repo 'opensearch-2.x': repomd.xml GPG signature verification error: Bad GPG signature

```

I’m running AlmaLinux 8.10 and did have Opensearch installed on here before, but it was an older version… 2.8 I think it was. Initially, I was trying to just update OS to 2.15 but I was getting that same error and ended up yum removing it, thinking I could just start over.

Once removed, I followed the instructions here:

> **[RPM](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/rpm/#install-opensearch-from-a-yum-repository)**
>
> Documentation for OpenSearch, the Apache 2.0 search, analytics, and visualization suite with advanced security, alerting, SQL support, automated index management, deep performance analysis, and more.

but am getting that error.

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Mantas](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Mantas](https://forum.opensearch.org/u/Mantas)\
**Post date:** [June 27, 2024, 3:25pm UTC](https://forum.opensearch.org/t/failed-to-download-metadata-bad-gpg-signature/20037/2 "2024-06-27T15:25:12Z")

</div>

Hi @cawFEHman,

I have installed it in my lab with no issues following the instructions above with Alma 8.10 and OpenSearch 2.15:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/8/802bb35e438998637a5a7f2f5e57c0b310c69925.png)  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/1/18ac8f670748e0334167a2ba5c1a83155ef2b628.png)

Could you share the output of:

```auto
ls -l /etc/yum.repos.d/
cat /etc/yum.repos.d/opensearch-2.x.repo

```

Best,  
mj

---

<div class="post-metadata">

**Author:** ![cawFEHman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/cawfehman/32/5379_2.png) [@cawFEHman](https://forum.opensearch.org/u/cawFEHman)\
**Post date:** [June 27, 2024, 3:36pm UTC](https://forum.opensearch.org/t/failed-to-download-metadata-bad-gpg-signature/20037/3 "2024-06-27T15:36:19Z")

</div>

thank you for the time… here’s the outputs…

```auto
ls -l /etc/yum.repos.d/
total 40
-rw-r--r--. 1 root root 943 May 22 10:49 almalinux-ha.repo
-rw-r--r--. 1 root root 905 May 22 10:49 almalinux-nfv.repo
-rw-r--r--. 1 root root 885 May 22 10:49 almalinux-plus.repo
-rw-r--r--. 1 root root 963 May 22 10:49 almalinux-powertools.repo
-rw-r--r--. 1 root root 2666 May 22 10:49 almalinux.repo
-rw-r--r--. 1 root root 1041 May 22 10:49 almalinux-resilientstorage.repo
-rw-r--r--. 1 root root 871 May 22 10:49 almalinux-rt.repo
-rw-r--r--. 1 root root 928 May 22 10:49 almalinux-saphana.repo
-rw-r--r--. 1 root root 873 May 22 10:49 almalinux-sap.repo
-rw-r--r--. 1 root root 242 Jun 27 09:36 opensearch-2.x.repo

cat /etc/yum.repos.d/opensearch-2.x.repo
[opensearch-2.x]
name=OpenSearch 2.x
baseurl=https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/yum
enabled=1
repo_gpgcheck=1
gpgcheck=1
gpgkey=https://artifacts.opensearch.org/publickeys/opensearch.pgp
autorefresh=1
type=rpm-md

```

---

<div class="post-metadata">

**Author:** ![Mantas](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Mantas](https://forum.opensearch.org/u/Mantas)\
**Post date:** [June 27, 2024, 3:48pm UTC](https://forum.opensearch.org/t/failed-to-download-metadata-bad-gpg-signature/20037/4 "2024-06-27T15:48:57Z")

</div>

What dose the below return in the last 2 lines?

```auto

sudo yum list opensearch --showduplicates

```

---

<div class="post-metadata">

**Author:** ![cawFEHman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/cawfehman/32/5379_2.png) [@cawFEHman](https://forum.opensearch.org/u/cawFEHman)\
**Post date:** [June 27, 2024, 4:39pm UTC](https://forum.opensearch.org/t/failed-to-download-metadata-bad-gpg-signature/20037/5 "2024-06-27T16:39:08Z")

</div>

```auto
yum list opensearch --showduplicates
OpenSearch 2.x 2.6 kB/s | 498 B 00:00    
OpenSearch 2.x 74 kB/s | 4.2 kB 00:00    
OpenSearch 2.x 4.0 kB/s | 498 B 00:00    
Error: Failed to download metadata for repo 'opensearch-2.x': repomd.xml GPG signature verification error: Bad GPG signature

```

---

<div class="post-metadata">

**Author:** ![cawFEHman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/cawfehman/32/5379_2.png) [@cawFEHman](https://forum.opensearch.org/u/cawFEHman)\
**Post date:** [June 27, 2024, 5:45pm UTC](https://forum.opensearch.org/t/failed-to-download-metadata-bad-gpg-signature/20037/6 "2024-06-27T17:45:35Z")

</div>

Fixed it… found this article on RedHat… (sign in required)

> **[Failed to download metadata for repo 'rhel-8-for-x86\_64-baseos-rpms' - Red...](https://access.redhat.com/discussions/4656371?tour=8)**
>
> Access Red Hat’s knowledge, guidance, and support through your subscription.

One of the responses said to run

`sudo dnf clean all`  
`sudo rm -r /var/cache/dnf`  
`sudo dnf upgrade`

Ran those and when I ran the last command it asked to accept the new GPG key…

and VOILA! am able to install.

Thanks for your help

---

<div class="post-metadata">

**Author:** ![Mantas](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Mantas](https://forum.opensearch.org/u/Mantas)\
**Post date:** [June 28, 2024, 9:45am UTC](https://forum.opensearch.org/t/failed-to-download-metadata-bad-gpg-signature/20037/7 "2024-06-28T09:45:08Z")

</div>

Hi @cawFEHman,

Thanks for sharing your solution!

Best,  
mj
