Created
February 19, 2023 20:47
-
-
Save themactep/596e6e2430d8641db249cdede666c92d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Convert deprecated apt-key keys storage to GPG keys. | |
# Paul Philippov <paul@themactep.com> | |
# | |
keys=$(sudo apt-key list | grep -A1 ^pub | grep "^ " | sed "s/\s*//g" | sort | uniq) | |
for k in $keys; do | |
sudo apt-key export $k | \ | |
sudo gpg --dearmour -o /usr/share/keyrings/$k.gpg --yes && | |
sudo apt-key del $k | |
done | |
echo "Done" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment