GPG Error

I have fresh installation of ubuntu 14.04 now. When I updated my system, I faced the following GPG Error:

W: GPG error: trusty Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <>

As it is saying that “BADSIG 40976EAF437D05B5” signature is invalid. To solve this, I run the following command to import the keys:

sudo apt-key adv --keyserver --recv-keys 6AF0E1940624A220 40976EAF437D05B5


  1. apt-key: It is used to manage the list of keys used by apt to authenticate packages. Packages which have been authenticated using these keys will be considered trusted.
  2. adv: Pass advanced options to gpg. With adv –recv-key you can download the public key.
  3. For more details, read

But, it didn’t solve the issue. Then, I found a trick to remove this error. This was like given below:

Open your source.list using your favorite text editor, i.e.

$ sudo vim /etc/apt/sources.list

locate and replace it with

So, I remove the ‘in.’ prefix in each of the addresses to convert them to addresses of the main server. This solved my problem.


Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s