I have a new computer and installed Linux Mint. When I tried to install npm and then install the angular cli it won't let me, I get this error:
simon@simon:~$ sudo apt-get update
[sudo] password for simon:
E: Malformed line 2 in source list /etc/apt/sources.list.d/i2p-maintainers-i2p-bionic.list (type)
E: The list of sources could not be read.
While searching on stackoverflow in english, some answers commented to edit the file sources.list
or create a new one, but it doesn't work, it doesn't give me permission neither to edit or change it.
TO UPDATE
Given the comments of several about the source.list file, I get this:
GNU nano 2.9.3 sources.list
deb cdrom:[Linux Mint 19.3 Tricia - Release amd64 20191213]/ bionic contrib main non-free
route:
root@simon:/etc/apt# l apt.conf.d/ auth.conf.d/ preferences.d/ sources.list sources.list.d/ trusted.gpg trusted.gpg~ trusted.gpg.d/ root@ simon:/etc/apt# pwd /etc/apt root@simon:/etc/apt#
Any possible solution?
The content of the file
i2p-maintainers-i2p-bionic.list
should be the following:Due to some modification you have made to it, it is likely that its content has been altered causing an error in its format.
Since it is a file from a PPA repository , you can safely delete its content without affecting the proper functioning of the computer (only affecting the update of some packages).
After deleting it you can regenerate its repository file (to retrieve the update of said packages) with the following instruction:
Or, if you want to prevent the deletion, you can generate it again as follows:
Following either of these two solutions you will be able to do
sudo apt-get update
without complaining about this repository file.It would be helpful if you displayed the contents of that file with
cat
or any other program.Either way you could open a terminal and edit that file with:
And see what happens on that line, then save it. You can use any editor or program but having superuser permissions.
You could also see just what's on that (second) line with:
Or from there with:
Obscure and unnecessary section.
If you don't want to use the editor, after executing any of the above commands, you could use
sed
to edit the same file as follows (you should usesudo
).And you will see only the content of the modified file (but the file was not modified).
If you like what you saw, you can use the same command but with the parameter
-i.bak
using it assed -i.bak ...
and the file will be modified and will be like what you saw before, but leaving another backup file with the same name but with a ".bak" extension.