I am using Ubuntu 20.04 with Virtualbox on a Windows PC. I am trying to install libraries or simply update using apt-get by using:

 sudo apt-get install libncurses5-dev libncursesw5-dev

 sudo apt-get update

 apt-get update

but they all give this error:

E: Malformed entry 58 in list file /etc/apt/sources.list (Component)

E: The list of sources could not be read.

Line 58 in my sources.list is:

deb http://download.virtualbox.org/virtualbox/debian contrib

I am connected to the internet and I have disabled the firewall using
$ sudo ufw disable

I've seen other people have fixed their problem by changing the line that gives them an error but it is not the same as mine and I don't have enough experience to know what to change. Any ideas? Thanks in advance!

3

There are 3 best solutions below

0
cnmicha On

Try the following:

deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian focal contrib
2
leo On

this will fix it:

sed -i '/download.virtualbox.org/d' /etc/apt/sources.list
echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" >> /etc/apt/sources.list
0
Sidof On

First of all I'm not Linux expert .

E: Malformed entry 58 in list file /etc/apt/sources.list (Component) E: The list of sources could not be read. The error occur when you have install wrong package on you Os system. To solve it open /etc/apt/sources.list with nano or gedit and remove the specific line.

sudo gedit /etc/apt/sources.list

or

sudo nano /etc/apt/sources.list

By the end update package.

sudo apt-get update