Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I cannot install any packages for Ubuntu 12.04. Even after clearing files under:

/var/lib/dpkg/lists/partial/* /var/lib/dpkg/lists/*

Changed the repository and tried apt-get clean and all other resolutions provided by Ubuntu forums. Nothing worked, I had same issue before and reinstalled Ubuntu. But that is not the permanent solution.

:~$ sudo apt-get update
95% [1 Sources bzip2 0 B] [Waiting for headers] [Waiting for headers]bzip2: (stdin) is not a bzip2 file.
98% [2 Packages bzip2 0 B] [Connecting to (]bzip2: (stdin) is not a bzip2 file.
100% [6 Translation-en bzip2 0 B] [Waiting for headers]                                                                                                      154 B/s 0sbzip2: (stdin) is not a bzip2 file.
Fetched 5,722 B in 14s (403 B/s)
W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise_universe_source_Sources  Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise_main_binary-amd64_Packages  Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise_universe_binary-amd64_Packages  Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages  Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise_universe_binary-i386_Packages  Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise_universe_i18n_Translation-en  Encountered a section with no Package: header
E: Some index files failed to download. They have been ignored, or old ones used instead.

Hope Ubuntu developers should definitely know the quick workaround to fix this. This is a very common issue for all Ubuntu users which is unsolvable. Kindly create a global FAQ answers to fix this issue.

share|improve this question

marked as duplicate by Chris Wilson, vasa1, Raja, Mik, Tom Brossman Mar 7 '13 at 19:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

I had this problem before, fixed it by changing the protocol to ftp. try a mirror that supports ftp access. and if you are already using ftp, try a http mirror. – Anam Ahmed Mar 7 '13 at 7:56
Can you please post me the apt sources list which you have used for it – Sivaprakash Mar 7 '13 at 9:11
I have tried with a changing the mirror to an ftp. but it fails, hope there could be some other work around – Sivaprakash Mar 7 '13 at 9:20
What modifications have you made to the OS? Your prompt looks a bit "different". Why are you trying to download both i386 and amd64 packages? Where did you get your .iso from? – user25656 Mar 7 '13 at 9:36
apt-get failes due to the issue in wget. wget fails to download files. It downloads the files with 0 bytes. Anyone knows what could be the issue.. – Sivaprakash Mar 7 '13 at 10:03

Just remove the content of /var/lib/apt/lists directory:

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

then run:

sudo apt-get update

Source: Lorem's answer on Trouble downloading packages list due to a “Hash sum mismatch” error

share|improve this answer
This worked for me, thanks. – Tek Mar 31 '14 at 9:36
You're very welcome! – Frederik Spang Mar 31 '14 at 11:26
You have to properly attribute the answer. You have copy & pasted from here and according to SO license you have to 1) link to the original answer (which you have done) AND 2) attribute the original author with a link to its profile (which is missing). – Bakuriu Nov 5 '15 at 9:15
Hi Bakuriu - If you actually look at, and read my answer, I have done exactly that. – Frederik Spang Nov 5 '15 at 9:27
No you didn't. There's no mention to Lorem nor any link to his profile. A link to the question is not enough when you are plagiarizing an answer. – Bakuriu Nov 5 '15 at 14:12

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