Skip to content

Instantly share code, notes, and snippets.

@ictus4u
Created March 14, 2023 05:02
Show Gist options
  • Save ictus4u/a5b42f5f7861859a7582ab0befc980d4 to your computer and use it in GitHub Desktop.
Save ictus4u/a5b42f5f7861859a7582ab0befc980d4 to your computer and use it in GitHub Desktop.

Revisions

  1. ictus4u created this gist Mar 14, 2023.
    15 changes: 15 additions & 0 deletions split-apt-trusted-keyring.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    gpg -k --no-default-keyring --keyring /etc/apt/trusted.gpg | \
    grep '^ ' | \
    tr -d ' ' | \
    grep -Eo '.{8}$' | \
    while read fingerprint; do
    ((++i));
    gpg \
    --export \
    --output /tmp/${i}-archive-keyring.gpg \
    --yes \
    --no-default-keyring \
    --keyring /etc/apt/trusted.gpg \
    ${fingerprint} ;
    gpg -k --no-default-keyring --keyring /tmp/${i}-archive-keyring.gpg ;
    done