TranslateProject/sources/tech/20190815 Fix ‘E- The package cache file is corrupted, it has the wrong hash- Error In Ubuntu.md
2019-08-16 08:58:56 +08:00

3.8 KiB
Raw Blame History

Fix E: The package cache file is corrupted, it has the wrong hash Error In Ubuntu

Today, I tried to update the repository lists in my Ubuntu 18.04 LTS desktop and got an error that says E: The package cache file is corrupted, it has the wrong hash. Here is what I run from the Terminal and its output:

$ sudo apt update

Sample output:

Hit:1 http://it-mirrors.evowise.com/ubuntu bionic InRelease
Hit:2 http://it-mirrors.evowise.com/ubuntu bionic-updates InRelease
Hit:3 http://it-mirrors.evowise.com/ubuntu bionic-backports InRelease
Hit:4 http://it-mirrors.evowise.com/ubuntu bionic-security InRelease
Hit:5 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu bionic InRelease
Hit:7 http://ppa.launchpad.net/leaeasy/dde/ubuntu bionic InRelease
Hit:8 http://ppa.launchpad.net/rvm/smplayer/ubuntu bionic InRelease
Ign:6 https://dl.bintray.com/etcher/debian stable InRelease
Get:9 https://dl.bintray.com/etcher/debian stable Release [3,674 B]
Fetched 3,674 B in 3s (1,196 B/s)
Reading package lists... Done
E: The package cache file is corrupted, it has the wrong hash

“The package cache file is corrupted, it has the wrong hash” Error In Ubuntu

After couple Google searches, I found a workaround to fix this error.

If you ever encountered with this error, dont panic. Just run the following commands to fix it.

Before running the following command, double check you have added “*” at the end. It is very important to add ***** at the end of this command. If you dont add it, it will delete /var/lib/apt/lists/ directory and there is no way to bring it back. You have been warned!

$ sudo rm -rf /var/lib/apt/lists/*

Now I tried again to update the system using command:

$ sudo apt update

This time it works!! Hope this helps.


Suggested read:



via: https://www.ostechnix.com/fix-e-the-package-cache-file-is-corrupted-it-has-the-wrong-hash-error-in-ubuntu/

作者:sk 选题:lujun9972 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出