apt update throws warnings - how to fix?

gb flag

I'm migrating a website to a fresh Ubuntu 22 server hosted by Rackspace. I'm doing some initial config and hardening and I start with the usual:

apt update
apt upgrade

The apt update command spits out a couple of warnings:

W: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

Can anyone tell me how I might repair this problem? I'll certainly be asking rackspace to address this problem, but it I suspect they will not. The man page for apt-key(8) has this in the DEPRECATION section:

   Except for using apt-key del in maintainer scripts, the use of apt-key is
   deprecated. This section shows how to replace existing use of apt-key.

   If your existing use of apt-key add looks like this:

   wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -

   Then you can directly replace this with (though note the recommendation below):

   wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc

   Make sure to use the "asc" extension for ASCII armored keys and the
   "gpg" extension for the binary OpenPGP format (also known as "GPG key
   public ring"). The binary OpenPGP format works for all apt
   versions, while the ASCII armored format works for apt version >= 1.4.

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

These instructions seem valuable, but are mostly greek to me -- and I'm not sure what implications such changes might have. I need to fix this problem because I'd like to make an image from this server and use it as the foundation for numerous other web servers, app servers, etc. for quite some time.

I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.