In addition to the central /etc/apt/sources.list
, there's a directory that can contain individual files with sources. This directory is /etc/apt/sources.list.d/
. This type of setup, a central config file plus a directory with individual, smaller files, is quite common.
In your case, the malformed line isn't in the central sources.list
, but in one of the files in sources.list.d
, namely in docker.list
:
E: Malformed line 1 in source list /etc/apt/sources.list.d/docker.list (type)
E: The list of sources could not be read.
As a more general remark, it's often a good idea to read the error messages completely. In many cases they spell out where the problem is quite literally.
/etc/apt/sources.list.d/docker.list
since that is the file your system is complaining about. – terdon Mar 11 '24 at 15:11/etc/apt/sources.list.d/docker.list
and not the primarysources.list
file, but a file added by a user of your system withsudo
privileges. – guiverc Mar 11 '24 at 20:17