18

I have just installed 16.04 LTS. However, I cannot update.

$ sudo apt-get update
Fetched 34,3 MB in 1h 51min 52s (5.110 B/s)                                     
Reading package lists... Done
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-updates/universe/binary-i386/by-hash/SHA256/e145fc3961ba6091b075afe8b3a89a5f58e1346b7d6cb0a1f4166dfcc3201392  Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.

I tried to many thing, but didn't help. I tried the solutions from Trouble downloading packages list due to a "Hash sum mismatch" error, but it didn't solve the problem.

Zanna
  • 70,465
dumadum
  • 213
  • @GautamVashisht No I tried that solutions but it didn't solve the problem. – dumadum Nov 07 '16 at 19:14
  • 1
    Did you do sudo apt clean after doing sudo rm -rf /var/lib/apt/lists/* ? – Gautam Vashisht Nov 07 '16 at 19:17
  • It helped thanks, but now, I cannot install anything from terminal. For example:`sudo apt-get install opera Reading package lists... Done Building dependency tree
    Reading state information... Done Package opera is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

    E: Package 'opera' has no installation candidate `

    – dumadum Nov 08 '16 at 13:41
  • Do sudo apt update first and then do sudo apt install opera – Gautam Vashisht Nov 08 '16 at 13:53
  • @GautamVashisht I am sorry to forget to say, yes I did update than install opera. – dumadum Nov 08 '16 at 13:55
  • Opera is not present in official Ubuntu Software in Ubuntu 16.04 LTS. To install it, take a look at this link :- http://askubuntu.com/questions/765483/how-can-i-install-the-opera-browser-from-the-terminal – Gautam Vashisht Nov 08 '16 at 14:10
  • @GautamVashisht thanks for your help! it solved my problem. – dumadum Nov 08 '16 at 14:18

1 Answers1

25

To get rid of this error, hit the keyboard shortcut Ctrl+Alt+T to open a terminal window.

Then type the commands given below in the terminal one-by-one:

sudo rm -rf /var/lib/apt/lists/*
sudo apt clean
sudo apt update
muru
  • 197,895
  • 55
  • 485
  • 740
  • If you know the invalid file, you can just remove it, and update will run faster. Otherwise, you will have to download all again. – Thiago Falcao Sep 22 '17 at 17:06
  • I've used your solution, but it still failed with the following error messages: W: http://archive.canonical.com/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1) E: Failed to fetch http://download.nus.edu.sg/mirror/ubuntu/dists/xenial-updates/main/binary-amd64/Packages.xz Hash Sum mismatch – Clock ZHONG Oct 10 '17 at 08:44
  • @Clock ZHONG Run sudo rm -rf /var/cache/apt/* in terminal. If it still doesn't work, take a look at this link - https://askubuntu.com/questions/679233/failed-to-fetch-hash-sum-mismatch-tried-rm-apt-list-but-didnt-work . Hope it helps ! – Gautam Vashisht Oct 14 '17 at 07:27
  • @ Gautam Vashisht , thanks! I've fixed this issue by changing the repository server to the US UBUNTU official site. It seems not all Ubuntu's repository servers maintained well. I'm not sure how Ubuntu maintains those free repository servers, but it's obvious that there are some problems in the current management solution. – Clock ZHONG Oct 15 '17 at 08:51
  • Actually, why is this solution ignoring the security warning that this error message describes? why is it secure to just ignore this warning saying that the update source is maliciously modified or insecure? – matanox May 26 '18 at 22:40