GPG error in Ubuntu update

8,499

Solution 1

Try the following :

$ sudo add-apt-repository ppa:nilarimogard/webupd8
$ sudo apt-get update
$ sudo apt-get install launchpad-getkeys

Once installed, to import all the missing GPG keys for your PPAs, simply use the following command:

$ sudo launchpad-getkeys

It will run an update and try to import all missing GPG keys for you. After executing it, hope you don't see any GPG errors.

The link is a reference to the solution.

Solution 2

Fix the ownership of the .gnupg directory:

sudo chown -R saikirangvr:saikirangvr /home/saikirangvr/.gnupg

After that repeat the key importing command.

By the way, the gpg command has to be issued without sudo, in this way you will not break your file's ownership.

Share:
8,499

Related videos on Youtube

sai kiran grandhi
Author by

sai kiran grandhi

Updated on September 18, 2022

Comments

  • sai kiran grandhi
    sai kiran grandhi over 1 year

    When I run the sudo apt-get update, it results in the following

     Reading package lists... Done
     W: GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A1715D88E1DF1F24
     W: GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 551CE2FB4CBEDD5A
     W: GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1E9377A2BA9EF27F
    

    By googling I came to know the key is missing, and it can be obtained by running the following command with the corresponding hexadecimal numbers

     saikirangvr@ubuntu:~$ sudo gpg --keyserver subkeys.pgp.net --recv 551CE2FB4CBEDD5A
    

    But I was not able to fix this as this gave me the error

    gpg: WARNING: unsafe ownership on configuration file `/home/saikirangvr/.gnupg/gpg.conf'
    gpg: external program calls are disabled due to unsafe options file permissions
    gpg: keyserver communications error: general error
    gpg: keyserver receive failed: general error
    

    I tried many times but I was unable to fix. I was behind a proxy server in my college and I have configured the Ubuntu well to use behind the proxy.

    After using

     sudo chown -R saikirangvr:saikirangvr /home/saikirangvr/.gnupg
    

    the problem of unsafe ownership was gone, and it gave the following....

     sai@ubuntu:~/gpgpu-sim/ispass2009-benchmarks$ gpg --keyserver keyserver.ubuntu.com --recv 1E9377A2BA9EF27F 
     gpg: requesting key BA9EF27F from hkp server keyserver.ubuntu.com
     gpgkeys: key 1E9377A2BA9EF27F not found on keyserver
     gpg: no valid OpenPGP data found.
     gpg: Total number processed: 0
     sai@ubuntu:~/gpgpu-sim/ispass2009-benchmarks$ gpg --keyserver subkeys.pgp.net --recv 1E9377A2BA9EF27F
     gpg: requesting key BA9EF27F from hkp server subkeys.pgp.net
     gpgkeys: key 1E9377A2BA9EF27F not found on keyserver
     gpg: no valid OpenPGP data found.
     gpg: Total number processed: 0
    

    the result of adding the ppa

    sai@ubuntu:~$ sudo add-apt-repository ppa:nilarimogard/webupd8
    [sudo] password for sai: 
    Error reading https://launchpad.net/api/1.0/~nilarimogard/+archive/webupd8: Couldn't resolve host 'launchpad.net'
    

    same error occurs when using launch pad get keys

     sai@ubuntu:~$ sudo launchpad-getkeys
    
     Please wait... launchpad-getkeys is running an update so 
     it can detect the missing GPG keys
    
     Trying to import all the missing keys
     gpg: requesting key 4C9D234C from hkp server keyserver.ubuntu.com
     gpgkeys: key 531EE72F4C9D234C not found on keyserver
     gpg: no valid OpenPGP data found.
     gpg: Total number processed: 0
     gpg: requesting key BA9EF27F from hkp server keyserver.ubuntu.com
     gpgkeys: key 1E9377A2BA9EF27F not found on keyserver
     gpg: no valid OpenPGP data found.
     gpg: Total number processed: 0
    
     launchpad-getkeys has finished importing all missing GPG keys. 
     Try running sudo apt-get update - you shouldn't see any key 
      errors anymore
    

    What is the problem. *Is there any other method to solve this like through GUI *.......

    • Kaushik Acharya
      Kaushik Acharya about 9 years
      you might have done a mistake similar to me. While installing Maven, I followed steps mentioned here: sysads.co.uk/2014/05/install-apache-maven-3-2-1-ubuntu-14-04 except the last step i.e. "Step 5: Remove PPA from sources.list" As a result of this I was getting GPG error similar to yours.
  • sai kiran grandhi
    sai kiran grandhi over 10 years
    It gave the following result for all the three keys I required.....gpg: requesting key BA9EF27F from hkp server subkeys.pgp.net gpgkeys: key 1E9377A2BA9EF27F not found on keyserver gpg: no valid OpenPGP data found. gpg: Total number processed: 0
  • sai kiran grandhi
    sai kiran grandhi over 10 years
    I followed the link ......stackoverflow.com/questions/13112400/… ,and gave me the error gpgkeys: HTTP fetch error 6: Couldn't resolve host 'keyserver.ubuntu.com' can you please help me...
  • m. öztürk
    m. öztürk over 10 years
    Try this: gpg --keyserver keyserver.ubuntu.com --recv 1E9377A2BA9EF27F
  • m. öztürk
    m. öztürk over 10 years
    The gpg key import has to be done without sudo!
  • sai kiran grandhi
    sai kiran grandhi over 10 years
    The same continued and Got this error on update Failed to fetch ppa.launchpad.net/launchpad.net/ppa/ubuntu/dists/lucid/main/‌​… 404 Not Found, I browsed through the link and also didn't found it
  • m. öztürk
    m. öztürk over 10 years
    Did you issued sudo apt-get update after gpg import?
  • sai kiran grandhi
    sai kiran grandhi over 10 years
    the command,gpg --keyserver keyserver.ubuntu.com --recv 1E9377A2BA9EF27F which you have mentioned didn't work and after I run update which gave 404 error......
  • sai kiran grandhi
    sai kiran grandhi over 10 years
    tried the link webupd8.org/2011/02/launchpad-getkeys-gets-proxy-support.htm‌​l but got the error sudo: launchpad-getkeys: command not found
  • shivshnkr
    shivshnkr over 10 years
    first u need to add repository, then run apt-get update so that package list can be updated, thereafter u need to install launchpad-getkeys. I too use internet connection that is behind proxy but it works fine for me.
  • sai kiran grandhi
    sai kiran grandhi over 10 years
    I have update the question with the errors I got, can you please help me.......
  • sai kiran grandhi
    sai kiran grandhi over 10 years
    I have updated the question with the errors I got, can you please help me.......