Score:1

How do I fix /etc/apt/sources.list

cn flag

I was trying to install wine on my chromebook, when I encountered an issue. Currently when I try to execute any command I receive the error message:

E: Malformed line 1 in source list /etc/apt/sources.list (type)
E: Type 'echo' is not known on line 5 in source list /etc/apt/sources.list.d/winehq.list
E: The list of sources could not be read.
E: Malformed line 1 in source list /etc/apt/sources.list (type)
E: Type 'echo' is not known on line 5 in source list /etc/apt/sources.list.d/winehq.list
E: The list of sources could not be read.

Because of this, I'm unable to install the nano editing software to fix whatever issue there may be. I've searched the internet for a solution for quite awhile and I'm not sure what to do at this point. Any help would be greatly appreciated.

Edit

sed -n 5p /etc/apt/sources.list.d/winehq.list outputs sed: can't read /etc/apt/sources.list.d/winehq.list: No such file or directory

head -n1 /etc/apt/sources.list outputs tee

Edit 2

The first command outputs nothing, and prompts a new entry (leading me to believe it worked considering there is a new error now.)

Running update leaves me with:

E: Malformed line 2 in source list /etc/apt/sources.list (type)
E: The list of sources could not be read.
Cole Jerum avatar
cn flag
Unfortunately it does not work, primarily because my system currently does not have nano installed, and when I attempt to install nano i get the exact same error message I stated above.
N0rbert avatar
zw flag
Then add the full output of `cat /etc/apt/sources.list` and `grep -r -v ^# /etc/apt//sources.list.d/ --include="*.list"` to the question. If long - use pastebin. What is your Ubuntu version?
bac0n avatar
cn flag
You can install [nano](https://packages.ubuntu.com/) manually, save it somewhere, and `dpkg -i nano_*.deb` from the command line.
karel avatar
sa flag
Does this answer your question? [How do I remove a malformed line from my sources.list?](https://askubuntu.com/questions/78951/how-do-i-remove-a-malformed-line-from-my-sources-list)
nobody avatar
gh flag
Boot up a live linux and repair the file from this live session.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.