Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Extract gpg keys from keyring trustdb.gpg

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
User avatar
modo72
Posts: 26
Joined: 2012-02-18 13:28
Has thanked: 1 time

Extract gpg keys from keyring trustdb.gpg

#1 Post by modo72 »

Hello out there, I ask myself why is nothing mentioned on the web, since apt-key is deprecated.
I want to get the asc file from a gpg key, for which I only have to key-ID. For example, if I download the gpg key from Kali Linux I put in

Code: Select all

 gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ED444FF07D8D0BF6  
and the gpg key is fetched, imported to the public keyring and written into my trustedb.gpg. But if want to use the Kali Linux repository I need the gpg-File. Whenever I see a tutorial about how to deal with the lack of apt-key the asc file is getting downloaded and written to /etc/apt/trusted.gpg.d but I don't know where can I get the ASC-file in the first place. So how can I "extract" a ASC file from the public keyring?

Thanks in advance

BR /Chris

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Extract gpg keys from keyring trustdb.gpg

#2 Post by Head_on_a_Stick »

Try

Code: Select all

gpg -o kali.gpg --export ED444FF07D8D0BF6
mv kali.gpg /etc/apt/trusted.gpg.d # as root
EDIT: simplified commands.
Last edited by Head_on_a_Stick on 2022-08-11 19:56, edited 2 times in total.
deadbang

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Extract gpg keys from keyring trustdb.gpg

#3 Post by sunrat »

Thanks for that @Head_on_a_Stick . Would you care to write a Howto for that and link to FAQ? Adding keys for external repos has bamboozled me a couple of times.
Nice to have you here again btw. The power of Head_on_a_Stick is irrepressible!

Incidentally, I'm not sure adding Kali repos to Debian will be free of problems. Question was asked and answered however. :mrgreen:
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
modo72
Posts: 26
Joined: 2012-02-18 13:28
Has thanked: 1 time

Re: Extract gpg keys from keyring trustdb.gpg

#4 Post by modo72 »

Also thanks form my side @Head_on_a_Stick. I wonder why nobody asked this question ever before?

@sunrat : sure this is an example to add another repository. Its of course a great opportunity to mess ones system up. Lot of people did this 14 years ago by adding ubuntus repos into debians sources.list. Was a funny time, but I didn't do that :D

Thanks again

BR Christian

@Head_on_a_Stick: can you recommend some special docu to gpg?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Extract gpg keys from keyring trustdb.gpg

#5 Post by Head_on_a_Stick »

sunrat wrote: 2022-08-11 13:33Would you care to write a Howto for that
Not really. We have enough FrankenDebian threads here as it is :mrgreen:

I was distracted and let the OP nerd snipe me.
modo72 wrote:can you recommend some special docu to gpg?
Have you seen gpg(1)? It is very comprehensive :mrgreen:

tl;dr: try stackexchange.
deadbang

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Extract gpg keys from keyring trustdb.gpg

#6 Post by sunrat »

Head_on_a_Stick wrote: 2022-08-11 14:45
sunrat wrote: 2022-08-11 13:33Would you care to write a Howto for that
Not really. We have enough FrankenDebian threads here as it is :mrgreen:
True dat. Something something deliver said bullet to one's foot ... :lol:
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 557
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 76 times
Been thanked: 85 times

Re: Extract gpg keys from keyring trustdb.gpg

#7 Post by wizard10000 »

I'm not gonna write a howto either but a hacky, hamhanded way to do this is

Code: Select all

cd /etc/apt
sudo cp trusted.gpg trusted.gpg.d
we see things not as they are, but as we are.
-- anais nin

Post Reply