Whenever I try to install something, I get the same error:
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/repo.mongodb.org_apt_ubuntu_dists_bionic_mongodb-org_4.0_multiverse_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.
I've tried to do the following:
sudo rm -r /var/lib/apt/lists/*
sudo apt-get clean && sudo apt-get update
which was the solution proposed in many places, but it didn't work.
Does anybody know how to fix this?
Remove mongo lists in:
/etc/apt/sources.list.d
then:
I seemed to have to do the following, which is a combination of several posts I've seen that didn't work for me.
1: Remove all mongo lists in
/etc/apt/sources.list.d
2: Remove everything in
/var/lib/apt/lists/
3: Clean
4: Update
Same problem Ubuntu 18.04.4 LTS
Solution: Use the following commands in this order
Move or remove mongodb-org-4.0.list, here I moved it with mv, use rm insteand to delete.
(Remember to change the directory, provide where you want to put it so that you can still reuse it if things go wrong)
remove all lists
regenerate them
Now you can use again Software Updater.
Remove the problematic repositories, then try removing the MergeList, and then regenerate it: