6

Hello all i am installing Jenkins server but i am facing below issue.

W: GPG error: http://pkg.jenkins-ci.org binary/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9B7D32F2D50582E6

Please Help

I run this command gpg --import KEYS but it returns

gpg: can't open `KEYS': No such file or directory gpg: Total number processed: 0

I am using proxy for open internet.

3 Answers3

11

I myself had the same issue. After adding the Google keys from the official web repository, it worked.

Google helped with the following command:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <the key>

In this case:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9B7D32F2D50582E6
Simon Sudler
  • 3,931
  • 3
  • 21
  • 34
7

i think you are doing mistake to add gpg key. add key using command

wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -

and add repository

sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'

update source list

sudo apt-get update 

install jenkins

sudo apt-get install jenkins

if you already downloaded gpg key then add key using command

sudo apt-key add  jenkins-ci.org.key  
pl_rock
  • 11,297
6

This means key from jenkins site is not properly added.

  1. Run

    sudo apt-get update 
    

In the end you would get output like

Ign http://in.archive.ubuntu.com trusty/main Translation-en_IN                 
Ign http://in.archive.ubuntu.com trusty/multiverse Translation-en_IN           
Ign http://in.archive.ubuntu.com trusty/restricted Translation-en_IN           
Ign http://in.archive.ubuntu.com trusty/universe Translation-en_IN             
Fetched 181 B in 25s (7 B/s)                                                   
Reading package lists... Done
W: GPG error: http://pkg.jenkins-ci.org binary/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY < ???? >

???? - would be the key for you.

  1. Now use this key in the command below

    sudo gpg --keyserver  http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key --recv-keys ????
    

you would get response as

gpg: requesting key D50582E6 from http server pkg.jenkins-ci.org
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key D50582E6: public key "Kohsuke Kawaguchi <kk@kohsuke.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1
  1. Add to the sources using command.

    sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
    
  2. Now you can install using

    sudo apt-get install jenkins
    
Pilot6
  • 90,100
  • 91
  • 213
  • 324