'i try to run the command "sudo apt update" on my linux and it showing the error

E: Type 'mongodb-org/4.2' is not known on line 2 in source list /etc/apt/sources.list.d/mongodb-org-4.2.list
E: Malformed line 1 in source list /etc/apt/sources.list.d/some-ppa.list (type)
E: The list of sources could not be read.

how i can solve this



Solution 1:[1]

  1. Clean the current faulty mongo repo:

    rm -rf /etc/apt/sources.list.d/mongodb-org-4.2.list

  2. Update :

    apt update

  3. Follow the official instructions here:

    https://www.mongodb.com/docs/v4.2/tutorial/install-mongodb-on-ubuntu/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 R2D2