Fix Google app public key error or GPG error in linux

When executing the apt-get update in ubuntu OS command, You may get the public key Error message. Below we will solve public key error message while updating the google pagespeed .

[email protected]:/$ sudo apt update
 Ign:1 stable InRelease
Get:2 stable Release [2154 B]
Get:3 stable Release.gpg [819 B]
Ign:3 stable Release.gpg
Hit:4 bionic InRelease
Get:5 bionic-updates InRelease [88.7 kB]
Get:6 bionic-security InRelease [88.7 kB]
Get:7 bionic-backports InRelease [74.6 kB]
Get:8 bionic-updates/main amd64 Packages [658 kB]
Get:9 bionic-updates/universe amd64 Packages [958 kB]
Reading package lists… Done
W: GPG error: stable Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 6494C6D6997C215E
E: The repository ‘ stable Release’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

This type of issue comes when the application public key (or signing keY) do not match with system stored key.

Google signs its packages with GPG keys so that you (and your package manager) can “verify product updates”. When a GPG expires, changes, or is otherwise missing from your system your package manager will display an error, which is precisely what the mono-spaced junk above is.

Just downloading the key and installing like in below command will solve you issue.

[email protected]:/$ wget -q -O – | sudo apt-key add –
[email protected]:/$ sudo apt update

 Get:2 stable Release [2154 B]                                     
Get:3 stable Release.gpg [819 B]
Get:4 stable/main amd64 Packages [2043 B]
Hit:5 bionic InRelease
Hit:6 bionic-security InRelease
Hit:7 bionic-updates InRelease
Hit:8 bionic-backports InRelease
Fetched 5016 B in 1s (6288 B/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done