0

When I try to reinstall or remove Software Center, it says

E: Malformed line 7 in source list /etc/apt/sources.list (type)
E: The List of sources could not be read.

Please help.

  • Open terminal and paste the output of command cat /etc/apt/sources.list please. – mbiber Aug 06 '17 at 20:16
  • deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse /dev/null

    /dev/null

    – drippydj Aug 30 '17 at 22:28
  • (xenial)drippydj@localhost:~$ cat /etc/apt/sources.list deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse /dev/null @mbiber – drippydj Aug 30 '17 at 22:33

1 Answers1

0

The error message is telling you the problem. There is a problem on the 7th line of the sources list.

The privileges on that file require that you be root to edit it. in a terminal window, you can

cd /etc/apt
sudo nano sources.list

The system will ask for your password (unless you've done some magic with sudo) and then dump you into the top of the file in the nano editor. Press the down arrow 6 times.

All comment lines should start with a hash (#).

If the line is not a comment line, it should start with deb or deb-src. Compare it to other lines that are not commented, and you may see the error. At worst, as a temporary fix, you can add a hash (#) at the beginning of the line to ignore it as a comment.

Ctrl+O (the letter, not the number) to save, Ctrl+X to exit.