I get the following when running apt update: Key is stored in legacy trusted.gpg keyring…
- User
I get the following when running apt update: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details
Why is this warning shown, and how can it be fixed?
Assistant
The warning is shown because the apt package manager is deprecating the use of the legacy trusted.gpg keyring for storing trusted keys. Instead, it recommends using the new apt-key format.
- To fix this warning, you can follow these steps:
List existing keys(apt-key is also deprecated):
sudo apt-key list - Identify the key:
gpg --no-default-keyring --keyring /etc/apt/trusted.gpg --list-keys - Download the new key(replace KEY_URL with URL that contains the new key):
wget -O - KEY_URL | sudo apt-key add - - Update apt:
sudo apt update - Remove the original key after confirming the new key works:
sudo apt-key del KEY_ID
This should resolve the warning and allow you to continue using apt without any issues.
- To fix this warning, you can follow these steps:
List existing keys(apt-key is also deprecated):
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.