How to import missing key from all the repository in a one liner. @kalilinux #kali #kalilinux #linux #gpgkey #NO_PUBKEY

You get this error when you apt-get update

The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 1A1C1C101311121

How to import missing gpg key from all the repository in a oneliner.

Thanx to

https://www.linuxuprising.com/2019/06/fix-missing-gpg-key-apt-repository.html

sudo apt update 2>&1 1>/dev/null | sed -ne 's/.*NO_PUBKEY //p' | while read key; do if ! [[ ${keys[*]} =~ "$key" ]]; then sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys "$key"; keys+=("$key"); fi; done

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.