Recently I was installing Wine on my Ubuntu system while adding the Wine repository it displayed an error i.e. “E: Malformed entry 58 in list file /etc/apt/sources.list (Component)” you can see this in the image below.
Here I will explain why this error is caused and what are possible solutions to this.
Why this error is caused?
This error occurs because of some problem with the given line number. The possible reasons could be –
- You place / (slash) incorrectly in the URL.
- If you have copied the repository URL it might be caused by some space, it is recommended to delete each space and then save the file
- You added an incorrect URL.
There could be some other reasons but first, you should check and correct the above things.
The solution to this problem
Follow the given steps to solve this issue –
1. To fix this issue first run the given command and identify the line which is causing the problem.
sudo cat -n /etc/apt/source.list
This will display the given output in your terminal.
2. Open the /etc/apt/sources.list using a text editor and remove that line or comment it by placing a # at the starting of the line. Use the given command to open it.
sudo nano /etc/apt/sources.list
3. Now use the given command to refresh the package repository
sudo apt update && sudo apt upgrade -y
4. Try the command once again to add the wine repository now it should work perfectly.
As you can see in the given image now the same command is working perfectly.
Conclusion
I hope this fixes your issue but if you are still facing it then write us in the comments below.
My /etc/apt/sources.list is all messed up. Can you provide me with a generic /etc/apt/sources.list I can use to start from scratch?
Can you help me to fix that problem ?
lsb_release-cs: command not found
E: Malformed entry 50 in list file /etc/apt/sources.list (Component)
E: The list of sources could not be read.
Hi. Your manual got me farther than anything before.
But in the end it didn’t do it for me. Same error message.
I thought I might need to save it in the text editor, but it’s a read-only, I’m told that I don’t have permission.
Meaning I don’t get to update/upgrade.
p.s. so the problem of the text editor being a read-only solved itself. Literally. Today I thought I’d try the insanity-defining thing and try the same once more, even though it had not yielded in any results the times before. Today I could edit. Even though I’d had it sit for a couple days, doing nothing about it.
Apart from that it was your tutorial here that saved the situation. Clear, simple and to the point. Thank you, and I genuinely wish you a great week :)
The shortest solution is by:
sudo nano /etc/apt/sources.list
Then make sure that particular line has the correct link. The correct link is:
sudo add-apt-repository ‘deb https://dl.winehq.org/wine-builds/ubuntu/ focal main’
Where there IS a space BEFORE “focal main”
Save that file. You may now update the repository.
>_< you'v save my life… i Just need to put an "#" to fix my pop os 'apt'