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:
E: The package cache file is corrupted, it has the wrong hash
```
![][2]
“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, don’t 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 don’t 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
```
![][3]
This time it works!! Hope this helps.
* * *
**Suggested read:**
* [**How To Fix Broken Ubuntu OS Without Reinstalling It**][4]
* [**How to fix “Package operation failed” Error in Ubuntu**][5]
* [**Fix “dpkg: error: parsing file ‘/var/lib/dpkg/updates/0014′” Error In Ubuntu**][6]
* [**How To Fix “Kernel driver not installed (rc=-1908)” VirtualBox Error In Ubuntu**][7]
* [**How to fix ‘Failed to install the Extension pack’ error in Ubuntu**][8]