Thursday, 2 June 2011

apt-get: Hash Sum mismatch

Hi All,

So, sometimes, just when you think that apt-cacher-ng is your amazing solution, or you have managed to get apt-get going through a proxy, you get hit by something like this:

Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/lucid-updates/main/source/Sources.bz2 Hash Sum mismatch

That's no good is it? You try wget and that works fine, but apt just will not work. Here's how to fix it. Unfortunately I don't know what causes it. For me it has worked for ages and just broke one day and refused to work. Try the following (run as root):

touch /etc/apt/apt.conf.d/no-cache
nano /etc/apt/apt.conf.d/no-cache

type this line in and save it:

Acquire::http {No-Cache=True;};

The run:

apt-get update

This should now work with no problems.

Thanks for reading.

Trev

2 comments:

  1. Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-2.6.35-22_2.6.35-22.35_all.deb Size mismatch
    Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/s/samba/samba-common-bin_3.5.4~dfsg-1ubuntu8.5_i386.deb Size mismatch
    Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/o/openoffice.org/openoffice.org-calc_3.2.1-7ubuntu1.1_i386.deb Size mismatch
    Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/x/xulrunner-1.9.2/xulrunner-1.9.2_1.9.2.27+build1+nobinonly-0ubuntu0.10.10.1_i386.deb Size mismatch
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

    ReplyDelete
    Replies
    1. Clear out your apt cache in /var/cache/apt/archives, then run apt-get update again.

      Delete