Created
September 8, 2018 16:34
-
-
Save tilfin/bf0f96ea1f46594d83e5644412e9d3c9 to your computer and use it in GitHub Desktop.
Update all expired keys from Ubuntu key server in one command
This file contains hidden or 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
``` | |
sudo apt-key list | \ | |
grep "expired: " | \ | |
sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' | \ | |
xargs -n1 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys | |
``` | |
### Command explanation: | |
sudo apt-key list - lists all keys installed in the system; | |
grep "expired: " - leave only lines with expired keys; | |
sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' - extracts keys; | |
xargs -n1 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys - updates keys from Ubuntu key server by found expired ones. | |
Source |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/34733340/mongodb-gpg-invalid-signatures