I also know we need to migrate to fetching the .asc file directly and put the file into the /etc/apt/trusted.gpg.d/
folder.
Place keyrings in /usr/share/keyrings/
, NOT /etc/apt/trusted.gpg.d/
.
While the apt-key
warning message says to place keys in trusted.gpg.d
, Debian's "Instructions to connect to a third-party repository" (from which I will quote extensively) explicitly say not to do this:
The keyrings must be stored in "...a location only writable by root, which SHOULD be /usr/share/keyrings/
. The key MUST NOT be placed in /etc/apt/trusted.gpg.d
or loaded by apt-key add
."
Keyrings must be in binary .gpg
format instead of ascii-armored .asc
format.
"The reason why we avoid ASCII-armored files is that they can only be used by SecureApt
in version 1.4 or later (which appeared in stretch)."
Each 3rd party repo needs its sources file in /etc/apt/sources.list.d/
which should include the signed-by
option.
"Entries MUST be added in the /etc/apt/sources.list.d
directory using a shortened repository name (e.g. deriv.list
). The "Deb822" file format MAY be used instead to improve clarity for complex entries (e.g. deriv.sources
). (See sources.list(5)
) "
Each 3rd Party repo should also have a prefrences file in /etc/apt/preferences.d/
.
"When a repository is added to the sources.list.d
, a matching preferences file SHOULD be created to restrict the possible effects of the repository."
Where can I find the .asc files I need?
The most convenient way, assuming you already know the key ID or fingerprint, is to use GnuPG to retrieve them from a keyserver. In the case of the current Linux Mint and X2go repo signing keys:
gpg --keyserver keyserver.ubuntu.com --recv-keys 302F0738F465C1535761F965A6616109451BBBF2 972FD88FA0BAFB578D0476DFE1F958385BFE2B6E
From there you can export them to the correct binary .gpg
file in /usr/share/keyrings
(though I would first check to see if the keyrings are already there):
gpg --export 302F0738F465C1535761F965A6616109451BBBF2 | sudo tee /usr/share/keyrings/linuxmint-archive-keyring.gpg
gpg --export 972FD88FA0BAFB578D0476DFE1F958385BFE2B6E | sudo tee /usr/share/keyrings/x2go-archive-keyring.gpg
Are those .asc files even provided by Linux Mint / X2Go or other repos?
They are usually provided as a .deb package to allow automatic updating to new signing keys when they are issued. You'll have to search through the package tree to find the exact location, which in the case of Linux Mint is http://packages.linuxmint.com/pool/main/l/linuxmint-keyring/linuxmint-keyring_2016.05.26_all.deb.