Source Guru

Automated PPA GPG Keys

by Mez on Jun.07, 2009, under Personal

After reading Alan Pope’s recent post on installing GPG keys for PPAs easily, I thought I’d have a bit of a hack around.

Personally, I regularly add PPAs to my system, whether it be for Chromium Daily Builds, Bazaar, Gwibber, or anything else. I’ve found the most annoying thing is the installation of the GPG keys.

Now, I wouldn’t reccomend this for everyone, but, for some, it might be exactly what you’ve been looking for.

Here’s what I did:-

Firstly, I saved the Script that Alan linked to as /usr/local/bin/ppakeys and chmod’d it to 755. I then created a new file, “/etc/apt/apt.conf.d/05ppa” containing the following line

APT::Update::Pre-Invoke { "if [ -x /usr/local/bin/ppakeys ]; then /usr/local/bin/ppakeys; fi"; };

Now, every time I do a “sudo apt-get update” – it’ll check for new keys that I need, and install them as neccessary.

Magic!

<edit> Please make sure the quotes are correct if you copy and paste this!</edit>


8 Comments for this entry

  • zerwas

    Woah cool, thanks!

  • Ken Bloom

    A real secure technique

    This really defeats the whole purpose of using PGP signatures to secure the repository. The script, when not hooked into apt, will be slightly more secure becuase you’ll at least have to acknowledge that a new repository has been added, or its key has changed, before installing the key. Even better would be checking each key against the trust network in your personal GPG keychain, and asking confirmation before installing the key.

  • Trotamundos

    No, 05ppa must containg the following line:

    APT::Update::Pre-Invoke { “if [ -x /usr/local/bin/ppakeys/ ]; then /usr/local/bin/ppakeys/launchpad-update; fi”; };

  • TheNano

    I get
    -desktop:/etc/apt/apt.conf.d$ sudo apt-get update
    E: Syntax error /etc/apt/apt.conf.d/05ppa:2: Extra junk at end of file

    any idea , I needed to write in the code by hand and it worked.
    Thank you

  • TheNano

    I should mention that I was copying the code from planet.ubuntu.com , maybe copying it here could have worked!

  • Alan Pope

    Nice improvement Mez, like it!

  • Mez

    Ken, I agree, it’s not secure. But I’m happy for now to have it this way!

    I believe that most PPA keys wont show up in the trust chain though :(

    Maybe I can make some tweaks :D

  • ingalex

    Here you can find more than one script to add only missing gpg key or all gpg key: http://www.sourceslist.eu/guide/aggiungere-le-chiavi-gpg/

11 Trackbacks / Pingbacks for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!