It looks like apt-key
is deprecated from @Terrance.
Read this link https://www.linuxuprising.com/2021/01/apt-key-is-deprecated-how-to-add.html
In that link it states that Debian will be ending apt-key
as of April 2022. For now apt-key
still works as shown in the output in the question where it stated OK
which means that the key was imported.
In the future it is recommended to do the signed-by
with the repositories that you are adding.
All of this answer is from the link reworded.
First, download the key in question:
For ASCII type keys do it in this form:
wget -O- <https://example.com/key/repo-key.gpg> | gpg --dearmor | sudo tee /usr/share/keyrings/<myrepository>-archive-keyring.gpg
or
curl <https://example.com/key/repo-key.gpg> | gpg --dearmor > /usr/share/keyrings/<myrepository>-archive-keyring.gpg
For non-ASCII type keys do it in this form:
wget -O- <https://example.com/key/repo-key.gpg> | sudo tee /usr/share/keyrings/<myrepository-archive-keyring.gpg>
Or you can get your keys from a keyserver like so:
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/<myrepository>-archive-keyring.gpg --keyserver <hkp://keyserver.ubuntu.com:80> --recv-keys <fingerprint>
All keys will be stored in /usr/share/keyrings/
folder. You can use those keys when you add your repo with the signed-by
option to your sources.list file:
deb [signed-by=/usr/share/keyrings/<myrepository>-archive-keyring.gpg] <https://repository.example.com/debian/ stable main>
Or you can add the arch=amd64
in the same fashion:
deb [arch=amd64 signed-by=/usr/share/keyrings/<myrepository>-archive-keyring.gpg] <https://repository.example.com/debian/ stable main>
If this is helpful give thanks to @Terrance
signed-by
for the repositories moving forward.