8

when trying to update package listings via apt update or apt-get update I receive the following error:

E: Failed to fetch http://lt.archive.ubuntu.com/ubuntu/dists/xenial/universe/dep11/Components-amd64.yml.gz  Hash Sum mismatch
E: Failed to fetch http://lt.archive.ubuntu.com/ubuntu/dists/xenial/universe/dep11/icons-64x64.tar  Writing more data than expected (7468511 > 7467723) [IP: 193.219.61.87 80]

Is this somehow related to localised package distributor or is me all along? I am running beta2 release, that I've successfully installed and updated (without any error prompts) yesterday. Previously I used a 14.04 derivative which also did not bring up any errors. What can be the reason for this error?

EDIT: to duplicate markers, the topic name tackles a different problem rather than the hash sum problem, which is being referenced.

2
8

Add a parameter that adds a 'no-cache' header to the http/https requests. It asks the apt server to provide un-cached files. This can be useful if there are any kind of (broken) caching mechanism between your machine and apt mirror/server. (Such as proxy, transparent caching by ISP etc)

sudo apt -o Acquire::https::No-Cache=True -o Acquire::http::No-Cache=True update

just run this command in your terminal and it should work just fine

4
  • 1
    Please provide a broader explanation on what your offered command does Nov 9 '16 at 18:39
  • @PauliusŠukys I believe that adds a 'no-cache' header to the http/https requests. It asks the apt server to provide un-cached files. This can be useful if there are any kind of (broken) caching mechanism between your machine and apt mirror/server. (Such as proxy, transparent caching by ISP etc)
    – Shyam
    Nov 14 '16 at 7:03
  • This worked for me and the explanation by @Shyam makes sense, even though I agree it would be nice to have a more insightful answer.
    – Enrico
    Feb 9 '17 at 22:59
  • This doesn't work for me on Mint.
    – not2qubit
    Nov 22 '17 at 17:11
7

I think you've been accessing the local repo mirror while being updated. Wait some time (usually 1 hour is enough) before trying again. This can happen to all live releases, not just 16.04 (which is not officially out yet, as commented by someone else).

As an option, you could edit /etc/apt/sources.list to expunge the "lt" prefix with your favorite editor or use

sudo sed -i 's/http:\/\/lt\./http:\/\//g' /etc/apt/sources.list

This will make you access the main repositories at the cost of a slower access.

Of course, you can replace lt with your very own ISO 3166-1 alpha-2 country code.

1
  • Thanks, it seemed to be a slow mirror update, as both localised and main repository had the same update errors Mar 30 '16 at 10:38

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