Update apt/GPG keys🔗
Usually, people will give you a bunch of commands to follow, but I needed to do it a tiny bit quicker.
These guides usually tell you to find all the expired keys, and import them again, or eventually with a different keyserver.
Below is how you can do all of that in a single line:
apt-key list | grep expired | awk '{ print $2 }' | sed 's/^[^=/]*\///' | xargs -d\\n -n1 gpg --keyserver keyserver.ubuntu.com --recv-key
apt-key list
lists all the keysgrep expired
"filters" only the expired keysawk '{ print $2 }'
only shows the second column of the previous outputsed 's/^[^=/]*\///'
removes everything before the/
including the/
xargs -d\\n -n1 gpg --keyserver keyserver.ubuntu.com --recv-key
runs the key import for each expired key, and imports from the specified keyserver.
Although, another thing you may need to do also is run the below commands:
apt-get install debian-keyring debian-archive-keyring
apt-key update
apt-get update