Hash sum mismatch error while upgrading 18.04 LTS to 20.04 LTS from 18.04 LTS version from software update GUI [duplicate]
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:
sudo rm -rf /var/lib/apt/lists/*
then run:
sudo apt-get update
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:
sudo apt-get clean
sudo apt-get update
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 rm -rf /var/lib/apt/lists/partial
sudo apt-get update -o Acquire::CompressionTypes::Order::=gz
(thanks @brook_hong from the comments for the rm part)