• banner 3 banner 2 banner 1

Automatically Install Missing PPA GPG Keys With One Command (or your money back*)

Below is a simple script that automatically grabs any missing GPG keys.
abc If running an update ever spits this error at you: -

GPG error: http://ppa.launchpad.net jaunty release: 

The following signatures couldn’t be verified because 
the public key is not available: NO_PUBKEY DAA9427DCBF475C3
Why not solve it in one command? Seriously.

  1. Download this script: http://www.mediafire.com/?gnkmbteymna
  2. Move the downloaded script to your home folder
  3. Open a terminal and type: –
  • sudo ./launchpad-update

5. That’s it!

The script will automatically scan your enabled repos and PPA’s and grab the correct distribution key for your release. All you need to do is run it!

Every now and again you will need to run it twice in a row if it fails to pick up a key but that’s hardly a great effort – just press the up arrow on your keyboard when in a terminal and hit return.

*That was a joke.

Sources:
Post a comment or leave a trackback: Trackback URL.
  • lol

    It worked, Thanks.

  • Anonymous

    I have had so many problems with these keys in the past, and this clears up alot. I love your blog thanks for it. if you need free labor just contact me ill be more than willing to help you out with your blog.

  • UrCardiac

    Excellent!

  • http://www.snoopyonskittles.com/ Chris Tomalty

    I swear by this. I use it all the time! Excellent.

    They should build it into Ubuntu. That’s all I’m sayin’

  • Gorlock

    The script is too large. I don’t have the hard drive space to waste on such a huge script.

  • Rune Svendsen

    That’s brilliant! I’ve been looking for a way to backup my APT keys so I don’t have to retrieve them all again when reinstalling Ubuntu. Now I don’t have to! Thanks a lot!
    Plus, I got to learn a little bit of scripting as well by peeking at the script. I’ve been looking for a command like the cut-command for a while now.

  • http://omgubuntu.co.uk/ d0od

    8o |

  • Matt

    Awesome, thanks for that.

  • lol

    This actually made updating a lot faster as well.

  • http://thedaneshproject.com Danesh

    Cool script dude.

  • Name

    beautiful, thanks a million!!!

  • mrjack

    Thanks dude ! That was really helpful !

  • Alex

    If you want to do this on something derived from Ubuntu, e.g. Linux Mint, you will need to edit the script and manually set the RELEASE variable. For Linux Mint Gloria this would be:
    RELEASE=”jaunty”

  • katsanedowski

    sudo: ./launchpad-update: command not found

    any comments to this error?

  • http://omgubuntu.co.uk/ d0od

    You probably haven’t either named the script correctly, or cd to the corrected directory.

  • http://omgubuntu.co.uk/ d0od

    You probably haven’t either named the script correctly, or cd to the corrected directory.

  • Anonymous

    i changed the variable but cant seem to use it anyway :S
    command line: $ sudo ./launchpad-update
    Release:jaunty
    Please Wait…
    cat: keyss: No such file or directory
    rm: cannot remove `keyss’: No such file or directory

    please help out here!

  • Nishant

    Sadly, it did not work for me.
    When I ran the script, all it said was:

    Release: karmic
    Please Wait…

    and this persisted for half an hour at least. What could be the solution

  • http://omgubuntu.co.uk/ d0od

    Curious! I seem to get the very same thing yet this script worked a day or two ago…

  • Anonymous

    Current dropbox link it’s dead… this is a google code hosted one that’s working:
    http://apticons.googlecode.com/files/launchpad-update

  • http://twitter.com/vanHoi Ivo Reumkens

    The new link don’t work for me, I get a error forbidden.

    This is the file from the Ubuntu forum, but I’ve uploaded the file on my Ubuntu One: http://ubuntuone.com/p/6rR/

  • http://twitter.com/john_hamelink s0l1dsnak3123

    It’s 625 bytes. You are talking baloney.

  • Big Sarge

    I call Shenanigans!

  • Red Lego Man

    Fail. the link is a 404…

  • Anonymous

    I’m getting a 404 error on Dropbox :| Anyone got a script to fix it? :P

  • Big Sarge

    I keep getting “command not found” I have it in the home folder. What am I doing wrong now? Sometimes I hate being a noob.

  • Anonymous

    LOL.
    Opera even gives me a fraud warning when trying to download the script. :D

    I guess there’s a good reason to stick with the official repositories. :p
    However…
    sudo apt-add-repository ppa:blah/blubb
    This adds a PPA to the sources AND imports its key.
    And all that without shady scripts. ;)

  • Claudio

    404!!!!

  • Anonymous

    Some of the comments here say they were posted 9 months ago…

  • David

    Very useful!

  • Ryan1

    Google says there was the same post on 27.September 2009

    search for “launchpad-update.tar.gz” WITH the “”

  • http://twitter.com/threadnix threadnix

    Oops! (404)
    We can’t find the page you’re looking for. Check out our FAQ or forums for help. Or maybe you should try heading home.

  • http://slolinux.si kv1dr

    if you look at the link of this post you can see year and mounth of this post(…/2009/09/…)

  • http://twitter.com/Mkaysi Mika Suomalainen

    Dislike because link doesn’t work…

  • Egidijus
  • Claudio

    ok….just downloaded….if the command doesn’t work try: sudo sh launchpad-update.sh ……..it works very good for me!

  • Claudio

    very well…….sorry! :-)

  • Claudio

    or sudo ./launchpad-update.sh

  • Claudio

    yes….but this script is useful when a key has changed!

  • Nervengift

    wow like it soooo much :)

  • http://omgubuntu.co.uk/ d0od

    This is a post from a while back, the link was broken and a few people were asking in the comments of another post for something like this so I dusted it off and fixed the link. No biggie.

  • http://wakoopa.com/yo2boy yo2boy

    I only clicked for the money… /o

  • http://mpscripts.com Thomas Boxley

    This is great, I was just looking for something like this because I have about 10 PPAs and no keys, so the notifications that always came up after updating were getting annoying.

  • http://sensehofstede.nl/ Sense Hofstede

    You could also use the command that is available on every Ubuntu install: ‘add-apt-repository ppa:blabla/blabla’.

    That command takes the ‘ppa:blabla/blabla’ string and adds it to the package sources and then fetches the GPG key. All you have to do is run ‘apt-get update’ and everything should be working!

  • http://twitter.com/pinchemoojarra Jesus Moreno

    You have to mark it as executable.
    chmod +x launchpad-update.sh

  • http://omgubuntu.co.uk/ d0od

    The problem with that method is it infers people remember specifically which PPA’s are missing their keys and that the users can be bothered going to find the proper PPA address (ppa:blahblah/blah) to do that with. For most – running this script once is easier than finding out the addresses for the 10 ppa’s missing their keys as it requires zero effort on their part. Ofc, quite how people have PPA’s missing keys given the new ‘command’ I’m not sure, but people do.

  • Big Sarge

    Thanks, that worked!

  • Big Sarge

    I had to copy paste and it worked. Try that.

  • Big Sarge

    I had to copy paste and it worked. Try that.

  • Big Sarge

    I had to copy paste and it worked. Try that.

  • Anonymous

    You missed out the .sh part sudo ./launchpad-update.sh Very nice though, thanks.

  • http://twitter.com/Heimpjuh Heimen Stoffels

    Or you can just use Launchpad Getkeys from Webupd8:

    http://www.webupd8.org/2010/05/automatically-import-all-missing.html

  • Anonymous

    The apt-add-repository doesn’t always guarantee that the key will be added. I’ve had a couple fail to add the GPG key.

  • Grey Beard

    mine works without changing anything…
    (using Mint 9)

  • sxecry

    one command ^^
    for i in `sudo apt-get -qq update 2>&1 | sed ‘s/.*PUBKEY //’`; do sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys $i; done

  • http://nancib.wordpress.com/ BostonPeng

    Finally! This line needs to get added to the main article. I’m sure Big Sarge and I aren’t the only ones who missed this step.

  • http://twitter.com/explodingwalrus Carl Draper

    You need to set it as executable before running it. (right click –> permissions –> tick executable)

  • http://profiles.yahoo.com/u/4RCKB34LM3SLTPYH5OIEX6S57E Solomon

    +1

    I was wondering wtf was wrong with the script, but I should have already known.

  • Amith Viswanath

    thanks….this one worked for me

  • Anonymous

    Hi there, I’ve just made simplier this script by making a “batch like” sequence of commands, leaving the hole process in “one (long) line”. Btw, I’ve also uploaded the script into my public dropbox as a mirror of mediafire. Just copy and paste the following line command in your terminal:wget https://dl-web.dropbox.com/s/xetnyo2r5bnnh53/la... && mv launchpad-update.sh?dl launchpad-update.sh && chmod +x launchpad-update.sh && sudo ./launchpad-update.sh && sudo apt-get updateps. pueden visitarnos en seekNgeek blogspot para ver la nota completa. Gracias OMG por este script tan útil :)

  • rMatey180

    Worked for me. Found two keys….
    Rune Svendsen had a good idea about backing up your APT keys. I’m stealing that one..

  • Anonymous

    it is NOT available in EVERY ubuntu install…
    add-apt-repository was only added to ubuntu last year
    it is ONLY available in karmic, lucid and meerkat
    it can be added to jaunty by updating python-software-properties

  • http://wakoopa.com/xfact XFACT

    Bad joke! :P

  • andrea

    Works like a charms thanks!

  • http://profiles.yahoo.com/u/7GXJ4CL5A6A5YPPUO47UQXGP5Y Johan

    Yep, me too.

  • igorp1024

    sudo aptitude update 2>&1 | grep NO_PUBKEY | perl -pwe ‘s#^.+NO_PUBKEY (.+)$#$1#’ | xargs sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com

  • http://twitter.com/john_hamelink s0l1dsnak3123

    Thanks alot for this! :)

  • http://twitter.com/kent_stor Kent Storbakken

    Not sure if this has been mentioned and just putting this out there but the article is wrong when executing the script. You need to enter terminal and make it executable through chmod +x launchpad-update.sh first. Then the command to run it is sudo ./launchpad-update.sh.

  • Anonymous

    Wow. Works perfectly. No more errors! :)

  • Dave

    The command didn’t work for me, but this one did to activate the script:
    sudo bash ./launchpad-update.sh

blog comments powered by Disqus