Ubuntu: apt-get error, yarn signature verification

If you attempt an “apt-get update” and get a signature verification error from “dl.yarnpkg.com”, the problem is most likely an expired key.

This can be resolved by reloading the new public key from the site:

# add latest key
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

# try refresh again
sudo apt-get update

Below is the full error you would have seen at the console.

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 4F77679369475BAA
W: Failed to fetch https://dl.yarnpkg.com/debian/dists/stable/InRelease The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 4F77679369475BAA
W: Some index files failed to download. They have been ignored, or old ones used instead.

REFERENCES

Describes issue

Issue reported

Issue reported again

Discussion about issue on reddit