Malformed entry 1 in list file /etc/apt/sources.list.d/MongoDB.list (Suite)

ZayR picture ZayR · Jan 23, 2018 · Viewed 8.5k times · Source

I was trying to install MongoDb on Ubuntu 17.10 but i couldnt or there were some errors so I decided uninstall everything and reinstall fresh. So i did some purge commands that i found on the net and after doing that now if I do: sudo apt update

i get the following messages

sudo apt update

E: Malformed entry 1 in list file /etc/apt/sources.list.d/MongoDB.list (Suite)

E: Malformed entry 1 in list file /etc/apt/sources.list.d/mongodb.list (Suite)

E: The list of sources could not be read.

Answer

Icaro Tavares picture Icaro Tavares · Dec 1, 2019

In this case, as you dont have a specific line wrong in the file, better delete the file MongoDB.list and add again the respective PPA. Try it:

sudo rm /etc/apt/sources.list.d/MongoDb.list 

Add again the PPA from MongoDb

Now is time to update by running

sudo apt-get update