Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I check for updates, I get a "Failed To Download Repository Information" error.

This is what comes up under details:

W: Failed to fetch gzip:/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_natty_main_source_Sources  Hash Sum mismatch, 
E: Some index files failed to download. They have been ignored, or old ones used instead.
share|improve this question

12 Answers 12

up vote 277 down vote accepted

Just remove all the content of /var/lib/apt/lists directory:

sudo rm -rf /var/lib/apt/lists/*

then run:

sudo apt-get update
share|improve this answer
If you remove all files, you have to download them again. You can just remove the invalid file to make this process faster. – Behrang Jul 28 '13 at 12:51
I remember this happening with Debian, too. The solution was to switch repositories (eg, from to where XX is your country code) or waiting. The best idea would be to wait a bit and retry later. Removing the lists might fix broken lists, but that's rarely the case. – f.ardelian Jul 31 '13 at 10:58
Provide some explanation of the why this happen – Édouard Lopez Aug 2 '14 at 21:06
@AlyssaGono if it's a folder, you need to run rm with the recursive flag like so: sudo rm -R /var/lib/apt/lists/* however, even doing that didn't work for me. – mchid Dec 11 '14 at 3:33
after execute these comment, my problem still here – Jack Oct 10 '15 at 3:22

This is a known issue, and is exacerbated for clients behind proxy caches. Some large organisations and ISPs (especially in remote parts of the world) have transparent caches of which you may not be aware.

The fundamental issue is that the apt repository format is subject to race conditions when a mirror is updated. This problem particularly affects repositories that change rapidly, such as the development release.

You can track progress on the fix for this in this bug (please mark yourself as "affects me too" in the bug) and this blueprint. But be aware that it is a complex issue and may take more than one release to resolve.

share|improve this answer
Thanks for the only knowledgeable answer here. – MariusMatutiae Feb 4 '15 at 6:06
That blueprint is no longer accessible; here's an archived copy. – Eliah Kagan Apr 23 '15 at 15:13
this bug also exists on ubuntu 16.04 – Scott Stensland Mar 31 at 19:34
The bug has been marked as "Fix Released". – Paranoid Panda Apr 5 at 12:17

The easiest way to fix this is:

sudo apt-get clean
sudo apt-get update
share|improve this answer
After trying the accepted answer I still had the same errors, trying this immediately afterwards fixed the issue – Alex Oct 21 '15 at 10:50
Doing sudo rm -rf /var/lib/apt/lists/* then sudo apto-get clean fixed the problem for me also. Neither worked in isolation. – Cam Oct 29 '15 at 23:27
This should be the correct answer. – Clayton Dukes Jan 11 at 18:07
does not help on ubuntu 16.04 ... neither does the comment above help any – Scott Stensland Mar 31 at 19:46
@ScottStensland If you are still having trouble, you can switch to the main server instead of using the server for your nation or area. – mchid Apr 6 at 13:36

I still had the problem after removing the directories and doing sudo apt-get update.
Only the following step solved my problem:

sudo sed -i -re 's/\w+\.archive\.ubuntu\.com/' /etc/apt/sources.list

I don't know if this is the right way of fixing it...
I've found the solution here.

share|improve this answer
One should note that de-part indicates a server for Germany and that this script replaces to local server with the main server. Going to Software Sources the GUI-way and switching the setting there would be safer and reversible for a lot of users. The following should work for almost every country: sudo sed -i 's/[a-z][a-z]' /etc/apt/sources.list – LiveWireBT Sep 10 '14 at 19:53
works for me...thanks:) – user312381 Nov 26 '14 at 7:54
also worked for me, thanks!:) – MInner Mar 15 at 20:59
worked for me as well... Australian mirror was broken.. J – deepdive Apr 27 at 8:17

This can happen when your mirror is not up to date or serving errors from being overloaded. You can either wait a while and try again, or switch to another mirror:

share|improve this answer
Why does a server not being up to date, or being overloaded, cause a file with the correct name to successfully download (in the sense that the connection doesn't terminate until all the bytes are sent and received), but be corrupted? (I'm not asserting that doesn't happen, I'm just hoping you might be able to explain why it does.) – Eliah Kagan Aug 13 '12 at 21:30
@EliahKagan The problem normally is not that the file itself is corrupted, but that there is a (I am simplifying but not too much) data file and an index file containing the hash (fingerprint) of the data file. When the repositories are updated (happens every hour) on the server one file after the other gets updated. Now it can happen that your client (apt-get or similar) accesses the server when the data file has been updated but the index file has not been updated (or vice versa), yet. Then the hash doesn't match the data file and the client (falsely) assumes that the data file is corrupted. – Patrick Häcker Apr 14 '14 at 6:49
Changing the mirror worked for me when none of the above answers did. – mango Mar 25 at 16:16

The following commands may solve your issue.

sudo rm -R /var/lib/apt/lists/partial/*

and then

sudo apt-get update && sudo apt-get upgrade

it will solve your problem. I also faced the same problem but the above commands solved the problem for me. So give them a try.

Solution reference

share|improve this answer
I just tried, and it did not work; The first apt-get update created files in the same place again in that directory. – Volker Siegel Jan 23 '15 at 11:17
This solved my issue! Other solutions didn't. +1 – Andrea Romagnoli Jul 14 at 10:37

The only solution that worked for me is from unix.stackexchange.

It happens because there's a known bug it apt, and the solution is to update with a different compression method, so the files load correctly and the checksum succeeds.

Give this a try:

sudo apt-get update -o Acquire::CompressionTypes::Order::=gz
share|improve this answer
This is the only solution here that worked for me. Thanks. – Cerin Jun 21 at 17:53
It worked for me too. Note that you don't have to always run this command. Just run it once, and then you can run "apt-get update" without error. – dalf Jul 6 at 1:35

I had the exact same problem and all solutions provided using the terminal did not help.

For me, it was by going into:

Settings → Software & Updates → Other software: Uncheck all the boxes and press close.

It starts reloading the repos and updating. When I enter:

sudo apt-get update

After that, there was no problem at all. I'm using Ubuntu 13.10.

share|improve this answer
This does work yet it effectively blinds the machine from being able to install packages not part of the core build (until those checkboxes are re-activated later) ... yet necessary at times just to achieve an error free apt-get update which enables install of targeted packages – Scott Stensland Apr 6 at 15:39

I don't know that it's proper solution or not, but I did the following and the error message's gone:

After typing sudo apt-get update in terminal, it gives me the names of some packages which cause the error then I did the following:

Update manager(software update) → Setting → Configure Software Sources → Other software[tab] → Uncheck the packages

After pressing the "close" bottom, update manager started to check for update automatically again and I saw this message:"the software on this computer is up to date. Last checked 2 seconds ago."

Kubuntu 12.04

share|improve this answer

I have resolved all the packages not being installed by running

sudo apt-get install PACKAGENAME

for each of the packages. They are now installed and the "Hash Sum mismatch" error has gone.

share|improve this answer

I had a similar problem and solved it by opening theh application "Software & Updates" and, in "Ubuntu Software" tab, changing the value of "Download from" (in that drop-down list, try to select, for example, Main Server if it was not like that).

share|improve this answer

As follow @robie-basak, I used apt-cacher-ng as mirror caching. So I Remove the proxy and the problem solved.

I remove the proxy in file /etc/apt/apt.conf.d/01proxy:

#Acquire::http::Proxy "http://xxx.xx.xx.xx:4321";

Then need to:

sudo rm -rf /var/lib/apt/lists/*
sudo aptitude update
sudo aptitude upgrade
share|improve this answer

protected by Anwar Shah May 22 '15 at 15:16

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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