Some index files failed to download / public key not available [duplicate]

When I try to use

sudo apt-get update

it gives this error:

Fetched 5.530 kB in 53s (104 kB/s)
W: GPG error: http://extras.ubuntu.com precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192
W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release Unable to find expected entry 'main/binary-i386/Packages' in Release file (Wrong sources.list entry or malformed file)
E: Some index files failed to download. They have been ignored, or old ones used instead.

When I try to access to etc/apt folder, it said no such file or directory.

How can I fix this?


Solution 1:

Based on the error message, you have two problems; one related to the public key for a repository and the other related to Google Chrome.

To solve the public key problem, run this command:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <PUBKEY>

Replacing <PUBKEY> with the public key mentioned in the error message which is: 16126D3A3E5C1192.

The second problem is related to end of support for Chrome 32-bit. If you have a 32-bit system, you have no option other than migrating to Chromium. If you have a 64-bit system, run this command to force your system to look for only 64-bit updates of Google Chrome:

sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-chrome.list" "/opt/google/chrome/cron/google-chrome"

Solution 2:

I had this problem too, but this solved it for me.

Open a terminal window and run the following command:

sudo -H gedit /etc/apt/sources.list.d/google-chrome.list

Gedit will open a file. Change this file to make it read:

deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main

And try again.