By Ran T
After update to Ubuntu 22.04 running apt update && apt upgrade will produce the following warning:
W: https://repos.insights.digitalocean.com/apt/do-agent/dists/main/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
what can i do
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @rant,
One way to resolve this is to export the GPG key from the deprecated keyring and store it in /usr/share/keyrings. Fortunately, it’s not too difficult.
List existing key
- sudo apt-key list
From here, you’ll see the error of the you’ve given and right after it the contents of the file /etc/apt/trusted.gpg.
You’ll need to export the key from there use the following syntax to convert it into a GPG key and save it under the Trusted.gpg.d folder:
- sudo apt-key export last-8-copied-digits| sudo gpg –dearmour -o /usr/share/keyrings/key-name.gpg
Where the last-8-copied-digits would be replaced by the last 8 digits of the pub key. Additionally, the /usr/share/keyrings/key-name.gpg file - key-name.gpg should be replaced with the name of the problematic key. Let’s say it was about MySQL. The file will be called mysql-key.gpg. In your case, it should be about Do-agent.
Now we can update our apt source file for the repository (e.g., https://repos.insights.digitalocean.com/apt/do-agent/dists/main/InRelease), adding a signed-by tag:
deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://repos.insights.digitalocean.com/apt/do-agent/dists/main/InRelease stable main
Hope that helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.