我在 Windows PC 上使用 Ubuntu 20.04 和 Virtualbox。 我正在尝试安装库或简单地使用
apt-get
进行更新:
sudo apt-get install libncurses5-dev libncursesw5-dev
sudo apt-get update
apt-get update
但是他们都给出了这个错误:
E: Malformed entry 58 in list file /etc/apt/sources.list (Component)
E: The list of sources could not be read.
我的
sources.list
中的第58行是:
deb http://download.virtualbox.org/virtualbox/debian contrib
我已连接到互联网,并且已使用
禁用了防火墙
$ sudo ufw disable
我看到其他人通过更改给他们带来错误的行来解决他们的问题,但这与我的不一样,而且我没有足够的经验知道要更改什么。有任何想法吗?预先感谢!
尝试以下操作:
deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian focal contrib
这将解决它:
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
首先我不是 Linux 专家。
E:列表文件 /etc/apt/sources.list(组件)中格式错误的条目 58 E:无法读取来源列表。 当您在操作系统上安装错误的软件包时会出现此错误。 要解决此问题,请使用 nano 或 gedit 打开 /etc/apt/sources.list 并删除特定行。
sudo gedit /etc/apt/sources.list
或
sudo nano /etc/apt/sources.list
到最后更新包。
sudo apt-get update