This question already has an answer here:

I have installed a source.list with a mistake while trying to install spotify i.e. I wrote:

echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/sp 

instead of:

echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list

and now it seems that I can't install softwares with repository including spotify as I keep getting this message:

N: Ignoring file 'sp' in directory '/etc/apt/sources.list.d/' as it has no filename extension

in the terminal... How do I fix this?

marked as duplicate by muru, karel, terdon, Eric Carvalho, heemayl Sep 14 '15 at 20:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Just rename the file: sudo mv /etc/apt/sources.list.d/sp /etc/apt/sources.list.d/spotify.list – kos Sep 14 '15 at 9:19

It is often beneficial to understand what a command does, so let's break it down:

echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/sp

The echo part simply writes everything up to the pipe symbol | to the standard output, i.e the terminal. The pipe then takes this output (here deb http://repository.spotify.com stable non-free) and gives it to tee as input.

tee reads from standard input and writes it to a file. In your case the output of echo is written to the file /etc/apt/sources.list.d/sp, which is where the error is. sudo in front of tee is necessary to aquire root privileges, because only a user with root privileges is allowed to write to the directory /etc .

As a result of the typo, there is now a file sp in /etc/apt/sources.d/ - check this yourself via ls /etc/apt/sources.list.d/. You can view it's content with e.g. cat /etc/apt/sources.list.d/sp. According to apt it is ignored, because is does not have the file extension .list. Now it should be fairly obvious what to do: Give the file the proper name. Files are renamed aka. moved via the mv command:

sudo mv /etc/apt/sources.list.d/sp /etc/apt/sources.list.d/spotify.list

Convince yourself that now the file has the desired name.

Now try sudo apt-get update again, the error should disappear.

As a general remark, whenever in doubt what a command does, it is often a good idea to consult the corresponding man page

man command
  • I fixed a typo you made once (sources.d instead of sources.list.d) and upvoted. This is a good, understandable and very detailed answer that does not only solve the problem but allow people to learn from it. Please continue writing such great answers! :-) – Byte Commander Sep 14 '15 at 9:24
  • @ByteCommander Thanks for noting and correcting the mistake! I should've checked the text more thorougly, as things like errors in path tend to be quite frustrating for a beginner trying to follow instructions. – Nephente Sep 14 '15 at 9:32
  • It happens to the best of us, no worries! But yes, checking at least all commands for typos is a good thing to do before posting a thing. – Byte Commander Sep 14 '15 at 9:36
  • @OwenBeuchet As you're a new user here, please accept this answer if it solved your problem. To do this, you click the grey tick symbol on the left of it. That marks your question as answered and tells others that this solution helped you most. Make sure you have read through the tour to learn how AskUbuntu works, it only takes 2 minutes. – Byte Commander Sep 14 '15 at 9:38
  • New and glad to find such an helpful community. It worked fine. Thanks. – Owen Beuchet Sep 15 '15 at 18:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.