# APT-related question about GPG key rotation

**URL:** <https://community.grafana.com/t/apt-related-question-about-gpg-key-rotation/79661>\
**Category:** Site Feedback\
**Created:** [January 13, 2023, 12:39pm UTC](https://community.grafana.com/t/apt-related-question-about-gpg-key-rotation/79661 "2023-01-13T12:39:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaIng](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/michaing/32/29199_2.png) [@MichaIng](https://community.grafana.com/u/MichaIng)\
**Post date:** [January 13, 2023, 12:39pm UTC](https://community.grafana.com/t/apt-related-question-about-gpg-key-rotation/79661/1 "2023-01-13T12:39:48Z")

</div>

Hey guys,

on Debian I ran into an APT error and recognised [Grafana Labs update regarding CircleCI security updates | Grafana Labs](https://grafana.com/blog/2023/01/12/grafana-labs-update-regarding-circleci-security-updates/).

To update the key, I first did the steps I always do, which basically match the steps documented here: [https://apt.grafana.com/](https://apt.grafana.com/)

1. Download the `.key`
2. Convert it via `gpg --dearmor` into a `.gpg`

However, APT reports:

```auto
The key(s) in the keyring /path/to/grafana.gpg are ignored as the file has an unsupported filetype.

```

I guess with `apt-key add` (deprecated) it would result in the same invalid key.

What does work, is leaving the `.key` file untouched and add it like that as signing key to the repo via

```auto
[signed-by=/path/to/grafana.key] 

```

as documented in the blog post itself.

I never saw a case where the armored `.key` is used for APT authentication. Investigating why `--dearmor` does not create a valid key, I recognised that a second contained “revocation certificate” in the key is causing the issue. Removing it allows `gpg --dearmor` to create a valid `.gpg` key.

I’m not sure whether there is a specific reason for the way this is all done. Revoking a key in APT, AFAIK, cannot be done that way but simply requires to `apt-key del` the key or remove/replace the file. To preserve the common method and still documented way of adding APT keys, I suggest to remove the revocation certificate from the `.key` file and in case add it with a dedicated file, if this has use in other cases than APT.

---

<div class="post-metadata">

**Author:** ![MichaIng](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/michaing/32/29199_2.png) [@MichaIng](https://community.grafana.com/u/MichaIng)\
**Post date:** [January 14, 2023, 7:23pm UTC](https://community.grafana.com/t/apt-related-question-about-gpg-key-rotation/79661/2 "2023-01-14T19:23:32Z")

</div>

The revocation key was removed from `https://apt.grafana.com/gpg.key` and `gpg --dearmor` does hence now work without issues. Thanks guys 👍.
