The Ubuntu 20.04 GPG error: The following signatures couldn't be verified
is a most common error when attempting to include third party package repositories to the apt
package manager.
The GPG error should rather be treated as a warning against potential package installation from unknown sources. Therefore, the GPG error message prompts the user to verify and manually import the third party signature belonging to relevant package developer.
In this tutorial you will learn:
- How to import public key signature
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa |
Software | N/A |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
How to import GPG public key signature step by step instructions
- When you receive the GPG error message, first step is to take a note of the public key (NO_PUBKEY). Example:
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9578539176BAFBC6 Reading package lists... Done W: GPG error: http://ppa.launchpad.net/peek-developers/daily/ubuntu eoan InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9578539176BAFBC6
From the above output we can see that the missing public key signature is
9578539176BAFBC6
. - Use the key retrieved from the GPG error to import it to the Ubuntu 20.04 system by using the
apt-key
command. Example:$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 9578539176BAFBC6 Executing: /tmp/apt-key-gpghome.fnm4L3G3iP/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 9578539176BAFBC6 gpg: key 9578539176BAFBC6: public key "Launchpad PPA for Peek Developers" imported gpg: Total number processed: 1 gpg: imported: 1
- Confirm that the public key has been imported by listing all currently imported keys by executing the
apt-key list
command:$ apt-key list /etc/apt/trusted.gpg -------------------- pub rsa4096 2017-02-14 [SC] 8C95 3129 9E7D F2DC F681 B499 9578 5391 76BA FBC6 uid [ unknown] Launchpad PPA for Peek Developers /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-archive.gpg ------------------------------------------------------ pub rsa4096 2012-05-11 [SC] 790B C727 7767 219C 42C8 6F93 3B4F E6AC C0B2 1F32 uid [ unknown] Ubuntu Archive Automatic Signing Key (2012)
/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg ------------------------------------------------------ pub rsa4096 2012-05-11 [SC] 8439 38DF 228D 22F7 B374 2BC0 D94A A3F0 EFE2 1092 uid [ unknown] Ubuntu CD Image Automatic Signing Key (2012) /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg ------------------------------------------------------ pub rsa4096 2018-09-17 [SC] F6EC B376 2474 EDA9 D21B 7022 8719 20D1 991B C93C uid [ unknown] Ubuntu Archive Automatic Signing Key (2018)