3

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.

ZayR
  • 49
  • 1
  • 1
  • 3
  • i used the following command to delete mongodb >sudo apt-get purge mongodb-org* – ZayR Jan 23 '18 at 13:23
  • Getting $ sudo apt-get purge mongodb-enterprise E: Malformed entry 1 in list file /etc/apt/sources.list.d/mongodb-enterprise.list (URI) E: The list of sources could not be read. E: Malformed entry 1 in list file /etc/apt/sources.list.d/mongodb-enterprise.list (URI) E: The list of sources could not be read. – Rishabh Agrawal Jul 28 '18 at 11:37

2 Answers2

5

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:

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
alper
  • 2,919
  • 9
  • 53
  • 102
Icaro Tavares
  • 51
  • 1
  • 3
2

Try running following command

sudo sed -i -e '1d' /etc/apt/sources.list.d/mongodb-org-3.4.list

This would produce following error

E: Type '“deb' is not known on line 1 in source list /etc/apt/sources.list.d/mongodb-org-3.6.list
E: The list of sources could not be read.

Now to fix this, go to /etc/apt/sources.list.d and then open it with

nano mongodb-org-3.4.list

And here remove the double quotes (")

Try running sudo apt-get update now. Hopefully it will work.