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.
I hope this fixes your issue but if you are still facing it then write us in the comments below.