debian mirror : Hash Sum mismatch

11,651

Solution 1

If deleting /var/lib/apt/lists/* does not work...
(esp. if you're behind a proxy), fix "Hash Sum Mismatch" like this:

Create file /etc/apt/apt.conf.d/99fixbadproxy
with this content

Acquire::http::Pipeline-Depth 0;
Acquire::http::No-Cache true;
Acquire::BrokenProxy    true;

See also here

Solution 2

I this case the problem always is the difference between the hashsum stated in the InRelease and Release files located in dist/[name-of-your-distro]/ folder.

This files are used to verify that others like Packages.xz hasn't been altered. When the hashsum mismatch you get the error. Unfortunately rehashing and writing the new value is not enough, because you will also need to sing both *Release files with a private key that you don't own... a real tedious job.

In my case I solved the problem (which in the first place was just use the local downloaded mirror) by removing the release files:

rm dist/[name-of-your-distro]/*Release*

and adding a trusted switch to the line corresponding to this repo in APT sources:

deb [trusted=yes] file:/path/to/your/local/mirror/ubuntu xenial main

Note the [trusted=yes]

Hope this helps, and even help me in the future :)

Solution 3

I had a similar problem and it seemed to be a problem on the mirror.

As stated here remove the files "InRelease" on the server and try again.

In the /debian/dists/jessie directory there was a file called InRelease. It had a date several months back from the other files (which were mostly dated today's date).

Share:
11,651

Related videos on Youtube

user311731
Author by

user311731

Updated on September 18, 2022

Comments

  • user311731
    user311731 over 1 year

    I have a mirror server that I maintain in school.

    $ uname -a Linux CSE-Cloud01 4.0.0-1-amd64 #1 SMP Debian 4.0.2-1 (2015-05-11) x86_64 GNU/Linux

    $ sudo apt-get update

    ......
     W: Failed to fetch http:// mirror.cs.nchu.edu.tw/debian/dists/jessie/main/source/Sources  Hash Sum mismatch    
        W: Failed to fetch http:// mirror.cs.nchu.edu.tw/debian/dists/jessie/main/binary-amd64/Packages  Hash Sum mismatch
    
    W: Failed to fetch http:// mirror.cs.nchu.edu.tw/debian/dists/jessie/non-free/binary-amd64/Packages Hash Sum mismatch
    
    W: Failed to fetch http:// mirror.cs.nchu.edu.tw/debian/dists/jessie/main/i18n/Translation-en  Hash Sum mismatch
    
    E: Some index files failed to download. They have been ignored, or old ones used instead.
    

    In mirror itself or some of my machines, It failed in the end.(some work properly.) I had tried to do the below commands that recommended, and won't work

    $ apt-get clean
    $ rm -rf /var/cache/apt/*
    $ rm -rf /var/lib/apt/lists/*
    $ apt-get update
    

    I can't find other solution on the internet. Did anyone know how to solve this problem?

    • spacebiker
      spacebiker over 5 years
      This solved my issue
  • user1794469
    user1794469 about 8 years
    Removing .../lists/* solved it for me.