Ubuntu / Linux news and application reviews.

Some time ago we wrote about a script to automatically install launchpad PPA GPG keys for all your repositories but you needed to run that script each time you would add a new PPA repository. But now thanks to a SourceGuru tip, you can have this script run automatically each time you do an update (apt-get update).

1. Save the script which adds the keys for all your PPA repos:

Download it, extract and put it in /usr/local/bin (or any other place, it's just an example but if you don't place it there, be sure to also modify the path in the next steps).

2. Chmod the script to 775. To do this, navigate to where the script was extracted and paste this in a terminal:
chmod 775 launchpad-update


3. Create a new file, "/etc/apt/apt.conf.d/05ppa" (file 05ppa which should be located in /etc/apt/apt.conf.d) and put this in it:

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


This will help you get rid of errors such as:
W: GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A9BF3BB4E5E17B5
W: GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B22AB97AF1CDFA9
W: You may want to run apt-get update to correct these problems