Avoid using deprecated 'apt-key add' on Debian 12 #114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The official Debian Wiki[1] and the man page for apt-key[2] both mark the addition of signing keys via the
apt-key add
mechanism as deprecated.One of the suggested alternatives is to place the key in the
/usr/share/keyrings
folder. This not only avoids using a deprecated feature, it also fixes a bug that will occur if the script is run as-is on Debian 12.The bug happens, because the
signed-by
field in theprod.list
file[3] references the signing key as followssigned-by=/usr/share/keyrings/microsoft-prod.gpg
This location is not where the signing key is found, if it is imported by
apt-key add
.This causes apt to not find the signing key and thus abort installation.
[1] https://wiki.debian.org/DebianRepository/UseThirdParty
[2] https://manpages.debian.org/bookworm/apt/apt-key.8.en.html
[3] https://packages.microsoft.com/config/debian/12/prod.list