Wednesday, November 15, 2017

How to fix GPG error “NO_PUBKEY” when running apt-get update

How to fix GPG error “NO_PUBKEY” when running apt-get update

Yesterday when i try to add PPA repository for webupd8team, i get an error saying GPG error: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886. This happens on lubuntu 17.10 artful aardvark, so how do i fix this issue?

There are two solution for this problem, the first one is by manually add the public key on your computer. The second solution is by installing y-ppa-manager that will take care the missing public key.

The Error
Get:5 http://ppa.launchpad.net/webupd8team/java/ubuntu artful InRelease [15.4 kB]
Err:5 http://ppa.launchpad.net/webupd8team/java/ubuntu artful InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/webupd8team/java/ubuntu artful InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886
E: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu artful InRelease' 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.

Solution 1
Use this special command for adding public key on your computer
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [PUBKEY]
sudo apt-get update
where [PUBKEY] is the code that found on the error message right after NO_PUBKEY, for example mine was C2518248EEA14886, your might be different.


Solution 2
Installing y-ppa-manager will also solve the problem
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install y-ppa-manager

No comments:

Post a Comment