Fixing GPG and ‘Duplicate Sources’ Errors

Here’s a confession: I haven’t installed any updates on my Ubuntu for a few months. The Software Updater still notified me of updated softwares, but I couldn’t install them. Whenever I chose to install the updates, or even download anything from the Software Center, it would tell me that it ‘requires installation of untrusted packages’. Installing from .debs and PPAs still works, though.

Courtesy of Robin Catling (http://catlingmindswipe.blogspot.com)

.Until yesterday, this is what I see when I run sudo apt-get update:
error

From my knowledge, the above meant that 1) Ubuntu won’t install new updates issued by Trusty’s PPA since it didn’t have (and couldn’t get) the ‘key’ that would verify it to be a legit, safe source, and 2) I have duplicate update sources.

I knew what the problems are, but I didn’t know how to fix it.

Running sudo apt-get update again won’t work. Someone recommended running launchpad-getkeys, available on Y PPA Manager‘s list of Advanced tools, to fetch missing GPG keys. It won’t process anything. Searching for duplicate PPAs with another tool in the same list gave no results. Another popular fix was sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys [missing key], but even that didn’t work.

I gave up for months after trying those fixes, until I revisited the issues yesterday by searching on Ask Ubuntu. One comment said that he could fix the GPG problem by deleting the entire contents of /etc/apt/trusted.gpg.d, which would remove all GPG keys of software sources:

cd /etc/apt/trusted.gpg.d

sudo rm -R *

sudo apt-get update

Then run launchpad-getkeys:

sudo launchpad-getkeys

launchpad-getkeys

launchpad-finish

 

What about the duplicate sources? It was painfully simple to fix. While looking on the ‘Other Software’ tab of Software & Updates, I noticed that I have two ‘Canonical Partners’ ticked on my sources list. I unticked one of them.
sources-marked
source-edit

Now I could install any updates I want.
sucess

Lesson learned: if you run Linux, you have to be willing to learn new things. And most  cases, you’re not the only one to have experienced the errors you see on your screen.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s