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 message "Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details" is related to the way that APT (Advanced Package Tool) manages its trusted keys.
In older versions of APT, trusted keys were stored in a single file,
/etc/apt/trusted.gpg. However, with the release of APT 1.2, the key management system was changed to use the GnuPG keyring system, which is more secure and flexible. The new system uses the files/etc/apt/trusted.gpg.d/to store the trusted keys.The warning message is shown because you are still using the legacy trusted.gpg file to store your trusted keys. This file is now considered deprecated and is no longer maintained by APT.
To resolve this issue, you should convert your legacy trusted.gpg file to the new format. You can do this by using the following command:
sudo apt-key exportall | sudo tee /etc/apt/trusted.gpg.d/legacy-keys.gpgAfter this, you should remove the legacy trusted.gpg file:
sudo rm /etc/apt/trusted.gpgOnce you have completed these steps, you should no longer see the warning message when running apt update.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.