Skip to content

Instantly share code, notes, and snippets.

@moehandi
Created January 20, 2018 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moehandi/638cfc74bd7481ce5711e04ad1cb4ec9 to your computer and use it in GitHub Desktop.
Save moehandi/638cfc74bd7481ce5711e04ad1cb4ec9 to your computer and use it in GitHub Desktop.
solve ubuntu expired key server
Update all expired keys from Ubuntu key server in one command:
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