Monday, 30 January 2012

How-to: Fix Untrusted Packages Error in Ubuntu 11.10

If you've added PPA's (Personal Package Archives) to your software sources in Ubuntu, you may find you get an error when you try to run updates in the Update Manager.

‘Requires installation of untrusted packages’

This is typically owing to missing GPG keys for those PPA's so that Update Manager can't verify those updates. It will simply refure to install those updates. It is easy to fix.


Open a Terminal session and run the command:

sudo apt-get update

The PPA's that are being refused will show up having no public key:

...
Ign http://extras.ubuntu.com oneiric/main Translation-en
Ign http://archive.canonical.com oneiric/partner Translation-en
Ign http://ppa.launchpad.net oneiric/main Translation-en_GB
Ign http://ppa.launchpad.net oneiric/main Translation-en
Ign http://ppa.launchpad.net oneiric/main Translation-en_GB
Ign http://ppa.launchpad.net oneiric/main Translation-en
Fetched 632 B in 1s (430 B/s)
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 52A794126E3AB2D3
W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8771ADB0816950D8


Take note (perhaps copy and paste from the terminal using shift-control-C to copy) those 16-digit hexadecimal key numbers appearing after ‘NO_PUBKEY’.

To install the missing public keys, run the command for each missing key, replacing my example with your key value:

sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 52A794126E3AB2D3

You should get a result looking something like this:

robin@D6400:~$ sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 52A794126E3AB2D3
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.xoyVBC269z --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --recv-key --keyserver keyserver.ubuntu.com 52A794126E3AB2D3
gpg: requesting key 6E3AB2D3 from hkp server keyserver.ubuntu.com
gpg: key 6E3AB2D3: public key "Launchpad Recent Notifications" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

You can then use the update command below to verify your software sources list, approving those PPA's for updates:

sudo apt-get update

Running Update Manager should now complete without this error. RC