How do you fix this?

When I type in terminal sudo apt-get update and enter my password. I get this:

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

I was trying to install some opensource razer software. Anyways, I screwed up!

I type sudo nano /etc/apt/sources.list and I get this:

deb https://repo.pureos.net/pureos/ amber main
deb-src https://repo.pureos.net/pureos/ amber main #Added by software-properties
deb https://repo.pureos.net/pureos/ amber-security main
deb https://repo.pureos.net/pureos/ amber-updates main

What am I missing or not seeing? Any help is greatly appreciated.
By the way I also tried to do a completely new PureOS re-install as a last resort and it didn’t work. Whoah!!

The problem lies in /etc/apt/sources.list.d/polychromatic.list.

Hmmmm? Are you also referring to this list?

. I had the polychromatic.list on there but its gone. Yet I still get that error message in terminal.

So the file /etc/apt/sources.list.d/polychromatic.list no longer exists?
$ ls /etc/apt/sources.list.d/polychromatic.list returns blank?

yes, its gone! but I’'m checking with that command you just gave me.

its returned the same command. /etc/apt/sources.list.d/polychromatic.list. that means its still in there?

Yes.

Do this:

sudo cat /etc/apt/sources.list.d/polychromatic.list

OK maladen I enter that command and this is what it gave me. cat: /etc/sources.list.d/polychromatic.list: No such file or directory. I think the way I deleted this must have been the problem? There’s probably a proper way of deleting this.

Please try this:

sudo ls /etc/apt/sources.list.d/*

Yes, looks like this is it. What I was trying to add on my sources list.

You realize that you are missing apt/ in that path, right?

If polychromatic.list has the same contents as polychromatic.list.save then I would just wipe out the former file. At least then you will be able to do apt update

If you want help with fixing polychromatic.list, you will have to make the current contents known to us.

Yes please help. Just let me know what to do.

As said,

and post the output here.

my output says exit

If the file contains a single line and that single line is the word “exit” then it sounds broken.

You have two options.

  1. You just want to get a working system again.
  2. You want to persevere with trying to install this software.

For option 1,

sudo rm /etc/apt/sources.list.d/polychromatic.list

and that should be it.

For option 2,

Please link to the web site where you got your information about what this file is supposed to contain and what steps you are to take.

My next question will probably be: which distro did you choose in order to follow instructions?

1 Like

Thank you Kieran. It looks like that did it. I followed option 1. Here is the link. https://software.opensuse.org/download.html?project=hardware%3Arazer&package=openrazer-meta I wished it worked.