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.
Just remove all the content of
/var/lib/apt/lists
directory:then run:
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.
The easiest way to fix this is:
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:
(thanks @brook_hong from the comments for the rm part)
I still had the problem after removing the directories and doing
sudo apt-get update
.Only the following step solved my problem:
I don't know if this is the right way of fixing it...
I've found the solution here.
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:
If you're behind a proxy, then create a file named
99fixbadproxy
in/etc/apt/apt.conf.d/
:Paste this into
99fixbadproxy
and save it:Now run the update command:
The accepted answer will rarely work if you have an issue with the CDN (content delivery network—the caches/mirrors around the world containing the apt lists and packages). It will work if a) you are using a PPA or local mirrors or b) have just a single mismatch to resolve.
It doesn't hurt to try, though, so start with:
This might be sufficient to proceed with
sudo apt-get upgrade
or other follow-up commands.But if it doesn't work...
You may get "Hash sum mismatch" errors from that command, too. If this happens, run:
It is possible that even this command will throw "Hash sum mismatch" errors, because the issue can come from transient network content errors. If so, continue to re-run the above
--fix-missing
command until it completes successfully. For example, like:(It should make progress with each run of
apt-get update --fix-missing
; if successive runs are not reducing the errors towards zero, press Ctrl-c to interrupt the loop. Then go back to the beginning of this answer with removing the contents of/var/lib/apt/lists
and try again.)After this, the update may work, but to be sure, first run
apt-get clean
, as so:Note that if you're doing this in preparation for an
apt-get upgrade
, it is possible (even likely, if you had enough mismatches to require updating several times) the upgrade will fail with "Hash sum mismatch" errors of its own. If so, add--fix-missing
to your upgrade command:and try again. (
apt-get upgrade
with--fix-missing
will also try holding back failing packages and continuing others, so you should see some additional progress from running this at least once.)But if it still doesn't work...
Like the earlier
until sudo...
command, you may get some further progress by repeating this command (always preceded by theclean
command above), which you can even automate withbut, usually, it will upgrade most of the upgradable packages the first time you run it with
--fix-missing
and after that get stuck on the same packages, making no further progress. At that point, you'll need to go back up to the beginning with thesudo rm -rf /var/lib/apt/lists/*
and try again. It is worth trying this whole process two or three times, especially if you have dozens or hundreds of upgradable packages.The following commands may solve your issue.
and then
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
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 → Ubuntu Software: Download from:
Change Local
toMain Server
.It starts reloading the repos and updating. When I enter:
After that, there was no problem at all. I'm using Ubuntu 14.04.4 LTS.