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
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
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.
Warning: 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 the entire
/var/lib/apt/lists/ directory and there is no way to recover it. 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.
- How To Fix Broken Ubuntu OS Without Reinstalling It
- How to fix “Package operation failed” Error in Ubuntu
- Fix “dpkg: error: parsing file ‘/var/lib/dpkg/updates/0014′” Error In Ubuntu
- How To Fix “Kernel driver not installed (rc=-1908)” VirtualBox Error In Ubuntu
- How to fix ‘Failed to install the Extension pack’ error in Ubuntu