Tuesday, 30 April 2013

W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6AF0E1940624A220

It all started when i executed -
sudo apt-get update 
on my Ubuntu 12.04(Precise Pangolin). After fetching the required updates it showed me an error at the bottom - W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6AF0E1940624A220

Screen-shot for the same is given below -

Clearly we need to download the key from Ubuntu key server.

Things to check before you see Approach 1 and 2.
  1. Open the file ~/.gnupg/gpg.conf with the editor.
  2. From the terminal gedit ~/.gnupg/gpg.conf
  3. Go to 116th like
    keyserver hkp://keys.gnupg.net
  4. Comment this out and add line above it so the setup now looks like
    keyserver http://keyserver.ubuntu.com
    # keyserver hkp://keys.gnupg.net
    # keyserver mailto:pgp-public-keys@keys.nl.pgp.net
    # keyserver ldap://keyserver.pgp.com
  5. Save the file.

Trying Reset(Did not help. Same error persisted)

Enter the following command on the terminal - 
sudo rm /var/lib/apt/lists/* -vf
and then update your system using following command - 
sudo apt-get update && sudo apt-get upgrade

  • 1st Approach(Did not Work for me)

    Run the following command -
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220This did not solve my problem. I got connection timed out.
    Generally Ubuntu key-server uses port 11371 which may be blocked by tour firewall. So you can use 80 as the port -
    sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6AF0E1940624A220

    But even this did not solve my problem -
    Errors i got by following both methods in this approach are in below screen-shot.

    Note :  Here if you are getting Connection refused then this may be a proxy problem. Check if you are behind any proxy or firewall.

  • 2nd Approach(Worked for me)

       If the command are not doing it for you, you have to do it on your own. After a long research on this problem i finally decided that the best thing to do was manually download the key and add it.This is how i did it.

    Go to Ubuntu Key-server(Click here). Here you can search your key. In my case it was 6AF0E1940624A220. Note while searching for key pre-append the key with 0x. So search for 0x6AF0E1940624A220

    Click on the link provided in the pub section.

    Copy the whole text(highlighted in below screen shot) from the page and save it in a file(say filename is key1).

Once you have copied the data to file. Save it. Then run the following command
sudo apt-key add key1

You will get an "OK" response.

aniket@aniket-Compaq-610:~/Desktop$ sudo apt-key add key1
[sudo] password for aniket:

And you are done. Repeat the procedure of other keys that might be missing.
Then you can run
sudo apt-get update
and you will not get any error. Update happens smoothly. Do let me know if you still have any doubts.

Related Links

Collection in Java

 What is Collection?

 Collection if we go by name means group of some entities. From a bit more technical perspective it means an object that groups multiple elements into single unit.Collections are used to store, retrieve, manipulate and communicate aggregate data.

Collection framework in Java

    A collection framework is a unified architecture for representing and manipulating collections.All collection frameworks contain the following - 

All of the collection framework is represented by the following picture -

Each of the above will be taken individually and explained but lets take one example to understand Collection frameworks.

First thing to note is that Collection interface is the top most entity in the entire Collection tree.Yes it is an interface and all other entities in Collection(List,Set,Queue) implement this Collection interface.Collection interface also implements an interface called Iterable which allows us to iterate over the elements stored in the collection but do not worry about it for now.We will explain it separately.
        If you see above picture List is a Collection.Note again that List is still an interface and multiple implementations of it are possible. Example we can have ArrayList, LinkedList, Stack, Vector etc. Each concrete implementations just mentioned will have different Algorithms associated with them.

Note :  Map interface and it's concrete implementations do not form a part of Collections i.e Map interface does not implement Collection yet it is a part of Java Collection framework. Also since Map interface does not extend Collection interface(which in turn implements Iterable interface) Map cannot be directly iterated over it's elements. There is another way of-course but we shall see it later.

Collections summed up!

t> UA-39527780-1 back to top