debian mirror : Hash Sum mismatch

Posted on

debian mirror : Hash Sum mismatch – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, debian, apt, mirror, .

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://  Hash Sum mismatch    
    W: Failed to fetch http://  Hash Sum mismatch

W: Failed to fetch http:// Hash Sum mismatch

W: Failed to fetch http://  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?

Solution :

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

Create file
with this content

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

See also here

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).

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 🙂

Following helped me (considering you are su)

  • apt-get clean
  • apt-get autoclean
  • apt-get remove
  • apt-get autoremove

Leave a Reply

Your email address will not be published. Required fields are marked *