This has happened twice where I followed instructions on installing software and then having the software center open then close immediately as a result of running the commands from the instructions. The first incident happened when I was trying to install Mono. I followed their instructions up to sudo tee /etc/apt/sources.list.d/mono-xamarin.list. The terminal stopped was not responding so I put the command back in and it just echoed it. So I closed it and tried it again with no luck. So then I wanted to check if the software center had just the Mono cs compiler and that's when the software center started closing immediately after opening and ubuntu gave me this error
E: Type 'sudo' is not known on line 2 in the source list /etc/apt/sources.list.d/mono-xamarin.list
E: The list of sources could not be read
E: The package lists or status file could not be parsed or opened.
I formatted my computer back to an earlier backup being unable to find an answer to this error and not knowing what I did wrong.
Now I tried installing Spotify and they have a similar list of instructions.
Add the Spotify repository
echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list
So I did until this point where the terminal was not responding again. I tried 'exit' to close it, but it just echoed the command. After I manually closed it, I checked the software center to see if I had done the same thing again, and I did. Software center will not stay open and returned this same error when I try apt-get autoremove
E: Type 'exit' is not known on line 1 in source list /etc/apt/sources.list.d/spotify.list
E: The list of sources could not be read.
E: The package lists or status file could not be parsed or opened.
My first question is how do I remove/repair the list, and my second is how do I use sudo tee... properly?