aptitude and apt-get update results in "Hash Sum mismatch"

If none of the more specific forums is the right place to ask

aptitude and apt-get update results in "Hash Sum mismatch"

Postby Lazylogic » 2015-05-22 11:41

Using Debian Jessie 32 bit and Wheezy 32 bit on 2 separate computers.

For the pass few days, received the following message on both computers when doing a
aptitude update or apt-get update results in the following error message:

W: Failed to fetch http://security.debian.org/dists/jes...ource/Sources: Hash Sum mismatch
W: Failed to fetch http://security.debian.org/dists/jes...i386/Packages: Hash Sum mismatch
W: Failed to fetch http://security.debian.org/dists/jes...ranslation-en: Hash Sum mismatch


Googled and tried removing /var/lib/apt/apt and /var/lib/apt/aptitude but the problem persist.

I have posted a similar thread in LinuxQuestions http://www.linuxquestions.org/questions/debian-26/aptitude-and-apt-get-update-results-in-hash-sum-mismatch-4175542905/#post5363975but not able to solve till now.


Any advise is appreciated.
Lazylogic
 
Posts: 22
Joined: 2007-04-22 10:38

Re: aptitude and apt-get update results in "Hash Sum mismatc

Postby emariz » 2015-05-22 21:59

What repositories are included in your sources list?
Empty the package cache (aptitude clean) and post the entire output of the package list update (aptitude update).
emariz
 
Posts: 2906
Joined: 2008-10-17 07:59

Re: aptitude and apt-get update results in "Hash Sum mismatc

Postby Lazylogic » 2015-05-22 23:41

emariz wrote:What repositories are included in your sources list?
Empty the package cache (aptitude clean) and post the entire output of the package list update (aptitude update).


aptitude clean && aptitude update as listed below

Ign http://dl.google.com stable InRelease
Hit http://dl.google.com stable Release.gpg
Hit http://dl.google.com stable Release
Hit http://security.debian.org jessie/updates InRelease
Hit http://dl.google.com stable/main i386 Packages
Get: 1 http://security.debian.org jessie/updates/main Sources [48.2 kB]
Ign http://dl.google.com stable/main Translation-en_SG
Ign http://dl.google.com stable/main Translation-en
Hit http://security.debian.org jessie/updates/contrib Sources
Hit http://security.debian.org jessie/updates/non-free Sources
Get: 2 http://security.debian.org jessie/updates/main i386 Packages [63.6 kB]
Hit http://security.debian.org jessie/updates/contrib i386 Packages
Hit http://security.debian.org jessie/updates/non-free i386 Packages
Hit http://security.debian.org jessie/updates/contrib Translation-en
Get: 3 http://security.debian.org jessie/updates/main Translation-en [31.3 kB]
Hit http://security.debian.org jessie/updates/non-free Translation-en
Hit http://httpredir.debian.org jessie InRelease
Hit http://debian-mirrors.sdinet.de stable InRelease
Get: 4 http://httpredir.debian.org jessie-updates InRelease [126 kB]
Hit http://httpredir.debian.org jessie-backports InRelease
Get: 5 http://httpredir.debian.org jessie/main Sources [7,065 kB]
Hit http://debian-mirrors.sdinet.de stable/main i386 Packages
Hit http://debian-mirrors.sdinet.de stable/non-free i386 Packages
Get: 6 http://httpredir.debian.org jessie/main Translation-en [4,585 kB]
Ign http://debian-mirrors.sdinet.de stable/main Translation-en_SG
Ign http://debian-mirrors.sdinet.de stable/main Translation-en
Get: 7 http://httpredir.debian.org jessie/non-free Translation-en [72.2 kB]
Ign http://debian-mirrors.sdinet.de stable/non-free Translation-en_SG
Hit http://httpredir.debian.org jessie/contrib Sources
Ign http://debian-mirrors.sdinet.de stable/non-free Translation-en
Get: 8 http://httpredir.debian.org jessie-updates/main Sources [2,471 B]
Hit http://httpredir.debian.org jessie-updates/contrib Sources
Hit http://httpredir.debian.org jessie/non-free Sources
Hit http://httpredir.debian.org jessie-updates/non-free Sources
Hit http://httpredir.debian.org jessie/main i386 Packages
Get: 9 http://httpredir.debian.org jessie-updates/main i386 Packages/DiffIndex [367 B]
Hit http://httpredir.debian.org jessie/contrib i386 Packages
Hit http://httpredir.debian.org jessie-updates/contrib i386 Packages
Hit http://httpredir.debian.org jessie-updates/non-free i386 Packages
Hit http://httpredir.debian.org jessie/non-free i386 Packages
Hit http://httpredir.debian.org jessie/contrib Translation-en
Hit http://httpredir.debian.org jessie-updates/contrib Translation-en
Get: 10 http://httpredir.debian.org jessie-updates/main Translation-en/DiffIndex [229 B]
Hit http://httpredir.debian.org jessie-updates/non-free Translation-en
Get: 11 http://httpredir.debian.org jessie-backports/main i386 Packages/DiffIndex [7,681 B]
Hit http://httpredir.debian.org jessie-backports/contrib i386 Packages
Get: 12 http://httpredir.debian.org jessie-backports/non-free i386 Packages/DiffIndex [229 B]
Hit http://httpredir.debian.org jessie-backports/contrib Translation-en
Get: 13 http://httpredir.debian.org jessie-backports/main Translation-en/DiffIndex [2,299 B]
Get: 14 http://httpredir.debian.org jessie-backports/non-free Translation-en/DiffIndex [229 B]
Hit http://httpredir.debian.org jessie-backports/main i386 Packages
Fetched 12.0 MB in 18s (644 kB/s)
W: Failed to fetch http://security.debian.org/dists/jessie ... ce/Sources: Hash Sum mismatch
W: Failed to fetch http://security.debian.org/dists/jessie ... 6/Packages: Hash Sum mismatch
W: Failed to fetch http://security.debian.org/dists/jessie ... slation-en: Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Couldn't rebuild package cache
Lazylogic
 
Posts: 22
Joined: 2007-04-22 10:38

Re: aptitude and apt-get update results in "Hash Sum mismatc

Postby emariz » 2015-05-23 02:35

Use code tags instead of quote ones.

Why did you not care to post the contents of /etc/apt/sources.list? The output of apt-cache policy will also be helpful.
Did you edit /etc/apt/preferences?

Does this bug report (1) describe your issue?
Let us be more aggressive and empty /var/lib/apt/lists/* and then rerun aptitude clean && aptitude update.

Is the Security repository the only one affected? All security updates are automatically added to the Proposed Updates repository (2), thus [in a non-critical system] one can disable the Security repository and track the Proposed Updates one to get, among other updates, the security fixes.


1. https://bugs.debian.org/cgi-bin/bugrepo ... bug=624122
2. https://www.debian.org/releases/proposed-updates.html
emariz
 
Posts: 2906
Joined: 2008-10-17 07:59

Re: aptitude and apt-get update results in "Hash Sum mismatc

Postby Lazylogic » 2015-05-24 01:46

Hi emariz, as requested:

# cat /etc/apt/sources.list
Code: Select all
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
deb http://httpredir.debian.org/debian jessie main contrib non-free
deb-src http://httpredir.debian.org/debian jessie main contrib non-free
deb http://httpredir.debian.org/debian jessie-updates main contrib non-free
deb-src http://httpredir.debian.org/debian jessie-updates main contrib non-free
deb http://httpredir.debian.org/debian jessie-backports main contrib non-free
deb http://debian-mirrors.sdinet.de/debian-multimedia stable main non-free


# apt-cache policy
Code: Select all
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://dl.google.com/linux/chrome/deb/ stable/main i386 Packages
     release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main
     origin dl.google.com
 500 http://debian-mirrors.sdinet.de/debian-multimedia/ stable/non-free i386 Packages
     release o=Unofficial Multimedia Packages,a=stable,n=jessie,l=Unofficial Multimedia Packages,c=non-free
     origin debian-mirrors.sdinet.de
 500 http://debian-mirrors.sdinet.de/debian-multimedia/ stable/main i386 Packages
     release o=Unofficial Multimedia Packages,a=stable,n=jessie,l=Unofficial Multimedia Packages,c=main
     origin debian-mirrors.sdinet.de
 500 http://httpredir.debian.org/debian/ jessie-backports/non-free Translation-en
 500 http://httpredir.debian.org/debian/ jessie-backports/main Translation-en
 500 http://httpredir.debian.org/debian/ jessie-backports/contrib Translation-en
 100 http://httpredir.debian.org/debian/ jessie-backports/non-free i386 Packages
     release o=Debian Backports,a=jessie-backports,n=jessie-backports,l=Debian Backports,c=non-free
     origin httpredir.debian.org
 100 http://httpredir.debian.org/debian/ jessie-backports/contrib i386 Packages
     release o=Debian Backports,a=jessie-backports,n=jessie-backports,l=Debian Backports,c=contrib
     origin httpredir.debian.org
 100 http://httpredir.debian.org/debian/ jessie-backports/main i386 Packages
     release o=Debian Backports,a=jessie-backports,n=jessie-backports,l=Debian Backports,c=main
     origin httpredir.debian.org
 500 http://httpredir.debian.org/debian/ jessie-updates/non-free Translation-en
 500 http://httpredir.debian.org/debian/ jessie-updates/main Translation-en
 500 http://httpredir.debian.org/debian/ jessie-updates/contrib Translation-en
 500 http://httpredir.debian.org/debian/ jessie-updates/non-free i386 Packages
     release o=Debian,a=stable-updates,n=jessie-updates,l=Debian,c=non-free
     origin httpredir.debian.org
 500 http://httpredir.debian.org/debian/ jessie-updates/contrib i386 Packages
     release o=Debian,a=stable-updates,n=jessie-updates,l=Debian,c=contrib
     origin httpredir.debian.org
 500 http://httpredir.debian.org/debian/ jessie-updates/main i386 Packages
     release o=Debian,a=stable-updates,n=jessie-updates,l=Debian,c=main
     origin httpredir.debian.org
 500 http://httpredir.debian.org/debian/ jessie/non-free Translation-en
 500 http://httpredir.debian.org/debian/ jessie/main Translation-en
 500 http://httpredir.debian.org/debian/ jessie/contrib Translation-en
 500 http://httpredir.debian.org/debian/ jessie/non-free i386 Packages
     release v=8.0,o=Debian,a=stable,n=jessie,l=Debian,c=non-free
     origin httpredir.debian.org
 500 http://httpredir.debian.org/debian/ jessie/contrib i386 Packages
     release v=8.0,o=Debian,a=stable,n=jessie,l=Debian,c=contrib
     origin httpredir.debian.org
 500 http://httpredir.debian.org/debian/ jessie/main i386 Packages
     release v=8.0,o=Debian,a=stable,n=jessie,l=Debian,c=main
     origin httpredir.debian.org
 500 http://security.debian.org/ jessie/updates/non-free Translation-en
 500 http://security.debian.org/ jessie/updates/contrib Translation-en
 500 http://security.debian.org/ jessie/updates/non-free i386 Packages
     release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=non-free
     origin security.debian.org
 500 http://security.debian.org/ jessie/updates/contrib i386 Packages
     release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=contrib
     origin security.debian.org
Pinned packages:


Did you edit /etc/apt/preferences?

Did on touched /etc/apt/preferences

# ls -R /var/lib/apt/lists/
Code: Select all
/var/lib/apt/lists/:
partial

/var/lib/apt/lists/partial:


# aptitude clean && aptitude update
Code: Select all
Ign http://dl.google.com stable InRelease
Hit http://dl.google.com stable Release.gpg                                                                                   
Hit http://dl.google.com stable Release                                                                                       
Get: 1 http://dl.google.com stable/main i386 Packages [1,178 B]                                                               
Ign http://dl.google.com stable/main Translation-en_SG                                                                       
Ign http://dl.google.com stable/main Translation-en                                                   
Hit http://security.debian.org jessie/updates InRelease                                               
Get: 2 http://security.debian.org jessie/updates/main Sources [48.2 kB]                                                       
Hit http://security.debian.org jessie/updates/contrib Sources                                                                 
Hit http://security.debian.org jessie/updates/non-free Sources                                                               
Get: 3 http://security.debian.org jessie/updates/main i386 Packages [63.6 kB]                                                 
Hit http://security.debian.org jessie/updates/contrib i386 Packages                                                           
Hit http://debian-mirrors.sdinet.de stable InRelease                                                                         
Hit http://security.debian.org jessie/updates/non-free i386 Packages                                                         
Hit http://httpredir.debian.org jessie InRelease                                                                             
Hit http://security.debian.org jessie/updates/contrib Translation-en                                                         
Get: 4 http://security.debian.org jessie/updates/main Translation-en [31.3 kB]                                               
Hit http://httpredir.debian.org jessie-updates InRelease                                                                     
Hit http://security.debian.org jessie/updates/non-free Translation-en                         
Get: 5 http://debian-mirrors.sdinet.de stable/main i386 Packages [151 kB]                     
Hit http://httpredir.debian.org jessie-backports InRelease
Get: 6 http://debian-mirrors.sdinet.de stable/non-free i386 Packages [6,497 B]           
Hit http://httpredir.debian.org jessie/main Sources                               
Hit http://httpredir.debian.org jessie/contrib Sources           
Hit http://httpredir.debian.org jessie/non-free Sources               
Hit http://httpredir.debian.org jessie/main i386 Packages             
Hit http://httpredir.debian.org jessie/contrib i386 Packages                                                                 
Hit http://httpredir.debian.org jessie/non-free i386 Packages                                                                 
Ign http://debian-mirrors.sdinet.de stable/main Translation-en_SG                                                             
Ign http://debian-mirrors.sdinet.de stable/main Translation-en                                                               
Get: 7 http://httpredir.debian.org jessie-updates/main i386 Packages/DiffIndex [367 B]                                       
Hit http://httpredir.debian.org jessie/contrib Translation-en                                                                 
Ign http://debian-mirrors.sdinet.de stable/non-free Translation-en_SG                                                         
Hit http://httpredir.debian.org jessie/main Translation-en                                                                   
Ign http://debian-mirrors.sdinet.de stable/non-free Translation-en                                                           
Hit http://httpredir.debian.org jessie/non-free Translation-en                                                               
Get: 8 http://httpredir.debian.org jessie-updates/main Translation-en/DiffIndex [229 B]                                       
Hit http://httpredir.debian.org jessie-updates/main Sources                                                                   
Get: 9 http://httpredir.debian.org jessie-backports/main i386 Packages/DiffIndex [7,681 B]                                   
Err http://httpredir.debian.org jessie-backports/main i386 Packages                                                           
Get: 10 http://httpredir.debian.org jessie-backports/non-free i386 Packages/DiffIndex [229 B]                                 
Hit http://httpredir.debian.org jessie-updates/contrib Sources                                                               
Get: 11 http://httpredir.debian.org jessie-backports/main Translation-en/DiffIndex [2,299 B]                                 
Get: 12 http://httpredir.debian.org jessie-backports/non-free Translation-en/DiffIndex [229 B]                               
Hit http://httpredir.debian.org jessie-updates/non-free Sources                                                               
Hit http://httpredir.debian.org jessie-updates/contrib Translation-en                                                         
Hit http://httpredir.debian.org jessie-updates/non-free Translation-en                                                       
Err http://httpredir.debian.org jessie-backports/main i386 Packages                                                           
Err http://httpredir.debian.org jessie-backports/main i386 Packages                                                           
Hit http://httpredir.debian.org jessie-backports/contrib Translation-en                                                       
Hit http://httpredir.debian.org jessie-updates/contrib i386 Packages                                                         
Hit http://httpredir.debian.org jessie-updates/non-free i386 Packages                                                         
Hit http://httpredir.debian.org jessie-backports/contrib i386 Packages                                                       
Hit http://httpredir.debian.org jessie-backports/main i386 Packages                                                           
Fetched 154 kB in 17s (8,590 B/s)                                                                                             
W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/source/Sources: Hash Sum mismatch
W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/binary-i386/Packages: Hash Sum mismatch
W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/i18n/Translation-en: Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Couldn't rebuild package cache


Is the Security repository the only one affected?

From the output of aptitude update, seems like Security repository is the only one affected.

All security updates are automatically added to the Proposed Updates repository (2), thus [in a non-critical system] one can disable the Security repository and track the Proposed Updates one to get, among other updates, the security fixes.

Hope I understand the above statement correctly. This means for that a a normal personal laptop [in a non-critical system], one can safety disable the Security repository and use https://www.debian.org/releases/proposed-updates.html to the same effect.
Code: Select all
#deb http://security.debian.org/ jessie/updates main contrib non-free
#deb-src http://security.debian.org/ jessie/updates main contrib non-free

deb http://ftp.us.debian.org/debian jessie-proposed-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian jessie-proposed-updates main contrib non-free


Thanks for the comments and advise.
Lazylogic
 
Posts: 22
Joined: 2007-04-22 10:38

Re: aptitude and apt-get update results in "Hash Sum mismatc

Postby squeeze » 2015-05-24 15:09

This happens then you run 'apt-get update' while the archive is updated (or the mirror) as some files are already up-to-date while others are still 'old'. So APT tries to verify the new Packages file with the hashsum of the old Packages file - which obviously fails and APT therefore refuses to use this file.

Waiting a bit will fix the 'problem'.

(APT refuses to use the file as it could be also a modified file either by an attacker on your connection or a compromised mirror or other funky attacks. So APT plays safe for your own protection - see 'man apt-secure'. But in reality its just a mirror which hasn't completely finished the update yet.)


From aptosid forums.

Also there are a lot suggestions out there in the google-universe ;-)
“Have you tried turning it off and on again?”
User avatar
squeeze
 
Posts: 299
Joined: 2010-06-14 23:16
Location: thimbleweedpark

Re: aptitude and apt-get update results in "Hash Sum mismatc

Postby emariz » 2015-05-24 20:30

Lazylogic wrote:Hope I understand the above statement correctly. This means for that a a normal personal laptop [in a non-critical system], one can safety disable the Security repository and use https://www.debian.org/releases/proposed-updates.html to the same effect.
Code: Select all
#deb http://security.debian.org/ jessie/updates main contrib non-free
#deb-src http://security.debian.org/ jessie/updates main contrib non-free

deb http://ftp.us.debian.org/debian jessie-proposed-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian jessie-proposed-updates main contrib non-free


Exactly.
For the last couple of years, I used Squeeze with Proposed Updates instead of the Security repository, and every and all security updates were added in a timely manner (among other updates.) On that page, one can even track what security fixes are missing from the Proposed Updates and why that is. I have yet to see a missing package.

Thanks for posting more information. Nothing odd there, though.

Lastly, are you sure that you need to track the source code of every package in every repository? Even if you compiled packages on a normal basis, it is a waste of bandwidth and resources to track them all.
emariz
 
Posts: 2906
Joined: 2008-10-17 07:59

Re: aptitude and apt-get update results in "Hash Sum mismatc

Postby Lazylogic » 2015-05-24 22:05

Lastly, are you sure that you need to track the source code of every package in every repository? Even if you compiled packages on a normal basis, it is a waste of bandwidth and resources to track them all.


Not reaaly needed, just left it there since it's there after install.
Lazylogic
 
Posts: 22
Joined: 2007-04-22 10:38


Return to General Questions

Who is online

Users browsing this forum: No registered users and 15 guests

fashionable