18

When I run sudo apt-get update I get four Hash Sum mismatch errors:

W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/Packages  Hash Sum mismatch    
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-amd64/Packages  Hash Sum mismatch    
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-i386/Packages  Hash Sum mismatch    
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-i386/Packages  Hash Sum mismatch

I tried fixing this with

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update 

but that didn't work and neither did

sudo apt-get clean
sudo apt-get update

or

sudo apt-get dist-upgrade
sudo apt-get update

Is there any other way I can try to fix this?

George Udosen
  • 37,534
jss367
  • 489
  • 2
  • 5
  • 16

3 Answers3

29

Run these commands in terminal 1:

sudo apt-get clean

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

That worked for me. :-)

Reference

George Udosen
  • 37,534
vahid-dan
  • 468
2

Usually switching to another mirror does the trick. It's easy in the GUI, but I suspect you want a CLI solution.

sudo sed -i 's|http://us.|http://|g' /etc/apt/sources.list edits your sources.list in-place to use the main server from the US mirror. You can substitute other mirrors, sudo sed -i 's|http://us.|http://fr.|g' /etc/apt/sources.list would choose the french server, starting from the US server.

If you switch to the main server like in the first line, be warned that simple swapping your search and replace terms to get the US mirror back would break your security and extras repos, if you use them. You would need to run a second sudo sed -i 's|http://us.security|http://security|g' /etc/apt/sources.list line to account for that, repeated for extras instead of security.

emk2203
  • 4,393
  • 1
  • 26
  • 52
0

Manually download the packages that are getting the Hash Sum Mismatch error and copy them to

/var/cache/apt/archive

Then again run

apt-get install <package-name>

It should now run correctly.

TheOdd
  • 3,012
ice
  • 1