Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Very recently when I have been attempting to check for updates on my laptop (Ubuntu 12.04), the check fails.

sudo apt-get update:

W: GPG error: http://us.archive.ubuntu.com precise Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/main/i18n/Index  No Hash entry in Release file /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise_main_i18n_Index
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/multiverse/i18n/Index  No Hash entry in Release file /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise_multiverse_i18n_Index
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/restricted/i18n/Index  No Hash entry in Release file /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise_restricted_i18n_Index
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/universe/i18n/Index  No Hash entry in Release file /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise_universe_i18n_Index
E: Some index files failed to download. They have been ignored, or old ones used instead.

/etc/apt/sources.list (comments removed):

deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted

deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted

deb http://us.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://us.archive.ubuntu.com/ubuntu/ precise universe
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates universe

deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse

deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

deb http://archive.canonical.com/ubuntu precise partner
deb-src http://archive.canonical.com/ubuntu precise partner

deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
deb http://archive.canonical.com/ precise partner
deb-src http://archive.canonical.com/ precise partner

I'm not sure how to solve the issue and appreciate any input.

share|improve this question
    
Not sure how this would translate into Ubuntu but I had a similar problem with Debian when my repos were pointing to squeeze. As wheezy was released, the Debian 6 repos were no longer called squeeze but oldstable. Maybe it's the same problem here and your repos are referring to a release by its codename. What does your /etc/apt/sources.list contain? –  Joseph R. Jul 11 '13 at 22:10
    
@JosephR. It's worth a shot. I added the contents of /etc/apt/sources.list to my post –  Alex Brooks Jul 11 '13 at 22:25
    
OK you're on Precise Pangolin, it seems, which is an LTS release so obviously this is not the problem... –  Joseph R. Jul 11 '13 at 22:33
    
On closer inspection of the error messages, have you tried removing the problematic files from /var/lib/apt/lists/partial ? Although removing them should be harmless, don't actually remove them, just rename them and try again. It may be that your apt cache got botched somehow. –  Joseph R. Jul 11 '13 at 22:37
    
@JosephR. I renamed the files and it got rid of all but the first error. I tried choroba's solution afterward to attempt to remove the first error with no success –  Alex Brooks Jul 12 '13 at 14:08
add comment

2 Answers

Try importing a new key:

gpg --keyserver keyserver.ubuntu.com --recv 40976EAF437D05B5
gpg --export --armor 40976EAF437D05B5 | sudo apt-key add -
share|improve this answer
    
I tried your solution but did not have any success; I still receive the same errors. Although when I ran the first command, I found this in the output: gpg: no ultimately trusted keys found –  Alex Brooks Jul 11 '13 at 22:27
add comment
up vote 0 down vote accepted

After a little more searching I have found the solution.

Remove/Rename the files associated with the errors:

cd /var/lib/apt/lists/partial/
sudo mv us.archive.ubuntu.com_ubuntu_dists_precise_main_i18n_Index main_COPY
sudo mv us.archive.ubuntu.com_ubuntu_dists_precise_multiverse_i18n_Index multi_COPY
sudo mv us.archive.ubuntu.com_ubuntu_dists_precise_restricted_i18n_Index res_COPY
sudo mv us.archive.ubuntu.com_ubuntu_dists_precise_universe_i18n_Index uni_COPY

Update the signature:

gpg --keyserver keyserver.ubuntu.com --recv 40976EAF437D05B5

Rebuild the software cache:

cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get update

It is probably possible to skip the first step by simply moving the lists, but I figured it best to describe the entire process I used to remove the errors.

I hope this helps anyone else having this problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.