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

10,477

Solution 1

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

Solution 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.

Share:
10,477
ZayR
Author by

ZayR

Updated on June 14, 2022

Comments

  • ZayR
    ZayR almost 2 years

    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
      ZayR over 6 years
      i used the following command to delete mongodb >sudo apt-get purge mongodb-org*
    • Rishabh Agrawal
      Rishabh Agrawal almost 6 years
      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.