# "Key is stored in legacy trusted.gpg keyring" warning

**URL:** https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470
**Category:** Support
**Created:** [2 במרץ,‏ 2026,‏ 8:41pm UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470 "2026-03-02T20:41:20Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [2 במרץ,‏ 2026,‏ 8:41pm UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/1 "2026-03-02T20:41:20Z")

</div>

When I run `sudo apt update` I see this:

> W: [https://download.docker.com/linux/ubuntu/dists/noble/InRelease:](https://download.docker.com/linux/ubuntu/dists/noble/InRelease:) Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

As it’s only a warning I’m tempted to do nothing, but what do you advise? Thanks.

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [3 במרץ,‏ 2026,‏ 6:09am UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/2 "2026-03-03T06:09:39Z")

</div>

Hi, it appears to just mean that your gpg keys are not in the right place.

> **[apt-key(8) — apt — Debian testing — Debian Manpages](https://manpages.debian.org/testing/apt/apt-key.8.en.html)**

```plaintext
*Recommended:* Instead of placing keys into the /etc/apt/trusted.gpg.d directory, you can place them anywhere on your filesystem by using the Signed-By option in your sources.list and pointing to the filename of the key. See [sources.list(5)](https://manpages.debian.org/testing/apt/sources.list.5.en.html) for details. Since APT 2.4, /etc/apt/keyrings is provided as the recommended location for keys not managed by packages. When using a deb822-style sources.list, and with apt version >= 2.4, the Signed-By option can also be used to include the full ASCII armored keyring directly in the sources.list without an additional file.

```

However, it is only a recommendation (despite the deprecated apt-key tool) so it’s entirely safe to ignore at the moment. I’m not sure what the correct steps are to suppress this (I’m more of an Arch person) but simply ignoring it shouldn’t cause problems especially if you’re on a LTS release or not bumping your major versions

You could certainly try just clearing the trusted directory (`rm -rf /etc/apt/trusted.gpg.d/*`) but in my opinion it isn’t worth risking breaking your packages to get rid of a message like this.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [3 במרץ,‏ 2026,‏ 7:09pm UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/3 "2026-03-03T19:09:55Z")

</div>

> [@darkpixlz](#):
>
> `rm -rf /etc/apt/trusted.gpg.d/*`

A word of caution to anyone visiting this in future, this is not the solution to your problem and improper handling of `rm -rf` commands can potentially nuke your whole system beyond repair. So please exercise caution.

There is ample documentation available online on how to get rid of the warning about key depreciation, but the issue is not discourse specific so I’ll leave a link and advise reading it twice before blindly executing any commands there.

> <https://stackoverflow.com/questions/68992799/warning-apt-key-is-deprecated-manage-keyring-files-in-trusted-gpg-d-instead>

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [3 במרץ,‏ 2026,‏ 11:13pm UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/4 "2026-03-03T23:13:00Z")

</div>

> [@itsbhanusharma](#):
>
> but the issue is not discourse specific

In my case it arguably is Discourse specific (though not in the way you mean) as I only have the server for a Discourse installation that followed the standard installation instructions.

But I’ll read the link you provided. Thank you.

Though an idiot’s guide would be much appreciated.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [4 במרץ,‏ 2026,‏ 4:46am UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/5 "2026-03-04T04:46:16Z")

</div>

> [@Jonathan5](#):
>
> Though an idiot’s guide would be much appreciated.

Take a full backup, set up a fresh instance of discourse and restore your backup there.

That way you don’t need to mess with anything and in 99% of cases your issue will be gone.

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [4 במרץ,‏ 2026,‏ 11:28pm UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/6 "2026-03-04T23:28:33Z")

</div>

I’d need an idiot’s guide for that too!

For instance, I only learnt recently that a full backup includes not only the backup you get using the Discourse website but also the app.yml file.

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [5 במרץ,‏ 2026,‏ 12:53am UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/7 "2026-03-05T00:53:16Z")

</div>

> [@Jonathan5](#):
>
> I’d need an idiot’s guide for that too!

If you’re not familiar with a shell, I would recommend downloading the backup off your current site and following [standard restore procedure](https://meta.discourse.org/t/create-download-and-restore-a-backup-of-your-discourse-database/122710).

However, if you’re even a little comfortable in the shell or don’t want to deal with configuring a temporary site then I would recommend [doing a CLI restore](https://meta.discourse.org/t/restore-a-backup-from-the-command-line/108034).

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [5 במרץ,‏ 2026,‏ 2:58am UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/8 "2026-03-05T02:58:48Z")

</div>

There are pretty elaborate guides already available for that:

> [@Backup discourse from the command line](https://meta.discourse.org/t/backup-discourse-from-the-command-line/64364):
>
> bookmark This guide covers how to back up and restore your Discourse site using command line tools, specifically designed for self-hosted environments. person_raising_hand Required user level: Administrator information_source You can use the below placeholders to automatically fill out the command line prompts in this guide: Backing up To create a backup of your Discourse site, follow these steps: Enter the container: ./launcher enter app Run the backup: discourse backup…

> [@Restore a backup from the command line](https://meta.discourse.org/t/restore-a-backup-from-the-command-line/108034):
>
> bookmark This guide explains how to restore a Discourse backup from the command line without using the Discourse web UI. person_raising_hand Required user level: Administrator wrench Console access required Here’s how to restore a Discourse backup from the command line, without ever booting the Discourse web UI. This is handy when you’re moving servers. Prerequisites Before you start, make sure you complete the following steps: Download the latest backup file from the source Disco…

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [5 במרץ,‏ 2026,‏ 6:26pm UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/9 "2026-03-05T18:26:19Z")

</div>

> [@darkpixlz](#):
>
> However, if you’re even a little comfortable in the shell or don’t want to deal with configuring a temporary site then I would recommend [doing a CLI restore](https://meta.discourse.org/t/restore-a-backup-from-the-command-line/108034).

This look simple, thanks. I’d be using a Digital Ocean droplet so imagine would have to update the DNS “A” record afterwards to the new IP address. I could reduce the TTL beforehand too. What about Amazon SES – I can’t remember but apart from re-enabling email (as in the guide) would there be any further steps to take?

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [6 במרץ,‏ 2026,‏ 1:11am UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/10 "2026-03-06T01:11:00Z")

</div>

> [@Jonathan5](#):
>
> I’d be using a Digital Ocean droplet so imagine would have to update the DNS “A” record afterwards to the new IP address.

Correct, if the machine has a new public IP you need to update the A record to point to the new server.

> [@Jonathan5](#):
>
> What about Amazon SES – I can’t remember but apart from re-enabling email (as in the guide) would there be any further steps to take?

Email configuration shouldn’t change as long as your `containers/app.yml` file stays the same. If Amazon is limiting the IP that can send mail through the key then that’s different but otherwise nothing changes.

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [6 במרץ,‏ 2026,‏ 11:15am UTC](https://meta.discourse.org/t/key-is-stored-in-legacy-trusted-gpg-keyring-warning/397470/11 "2026-03-06T11:15:30Z")

</div>

Thanks. I might do this soon then. I upgraded Ubuntu to 24.04 with Discourse _in situ_. It seemed to work all right, but this must just be an unforeseen consequence.
