12 July 2012

207. apt-get, apt-cacher-ng and hash sum mismatch

Update: Another day and we're back to the same crap with Hash sum mismatches. It's getting old...however, I'm beginning to suspect it's not the mirror, but my apt-cacher-ng.

I was getting a bit peeved with getting intermittent messages about 'hash sum mismatch' etc. when trying to do sudo apt-get update

Ign http://dl.google.com stable/main Translation-en                                                                                                                                                                                         
Fetched 17.1 MB in 9s (1,736 kB/s)                                                                                                                                                                                                          
W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_main_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_contrib_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_non-free_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_contrib_i18n_Translation-en  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_main_i18n_Translation-en  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_non-free_i18n_Translation-en  Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.


So I took action:
sudo rm -rf /var/cache/apt-cacher-ng/*

But then
sudo apt-get update    
Get:1 http://192.168.1.1 testing InRelease [190 kB]
Err http://192.168.1.1 testing InRelease                                                                                                                        
Ign http://192.168.1.1 stable InRelease                                                                                                                         
Get:2 http://192.168.1.1 stable Release.gpg [1,672 B]                                                                                    
..
Fetched 7,004 kB in 7s (965 kB/s)                                                                                                                                                                                                           
Reading package lists... Done
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://192.168.1.1 testing InRelease: File /var/lib/apt/lists/partial/192.168.1.1:3142_ftp.iinet.net.au_debian_debian_dists_testing_InRelease doesn't start with a clearsigned message

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/InRelease  

so I

sudo apt-get install debian-keyring

which didn't solve anything

Solution:
Edit you /etc/apt/sources.list and replace all instances of testing with wheezy, e.g.

deb http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/ wheezy main contrib non-free
deb http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/ stable main contrib non-free

I don't know if this has to do with the transition towards freezing wheezy, but basically, if you're having problems like that, have a look at what's actually on the mirror you're using. In my case I had a look at ftp://ftp.iinet.net.au/debian/debian/dists/ and found no 'testing' directory.


It also took care of these related messages on a different node:

Fetched 7,493 kB in 8s (885 kB/s)
W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/contrib/binary-amd64/PackagesIndex  MD5Sum mismatch

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/contrib/i18n/Translation-enIndex  MD5Sum mismatch

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/non-free/binary-amd64/PackagesIndex  MD5Sum mismatch

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/non-free/i18n/Translation-enIndex  MD5Sum mismatch

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/main/i18n/Translation-enIndex  MD5Sum mismatch

W: Failed to fetch http://192.168.1.1:3142/ftp.iinet.net.au/debian/debian/dists/testing/main/binary-amd64/PackagesIndex  MD5Sum mismatch

1 comment:

  1. Nice blog - first visit.
    I'm running wheezy on a number of systems in my lab and office. I found that I needed to manually remove /etc/apt/apt.conf.d/01proxy in spite of "aptitude purge apt-cacher" in order to stop the "failed to fetch http://192.168.1.1:3142" messages.

    ReplyDelete