使用 sudo apt install 进行 Virtualbox 安装时出现 ubuntu 20.04 错误

使用 sudo apt install 进行 Virtualbox 安装时出现 ubuntu 20.04 错误

使用命令 sudo apt install virtualbox

它的输出为

  virtualbox-6.1 6.1.32-149290~Ubuntu~eoan
  virtualbox-6.0 6.0.24-139119~Ubuntu~eoan
You should explicitly select one to install.

E: Package 'virtualbox' has no installation candidate

我尝试使用 sudo apt install virtualbox-6.1 6.1.32-149290~Ubuntu~eoan 但得到这个 E: Unable to locate package 6.1.32-149290~Ubuntu~eoan /etc/apt/sources.list包含

deb http://in.archive.ubuntu.com/ubuntu/ trusty main
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty main

###### Ubuntu Update Repos
deb http://in.archive.ubuntu.com/ubuntu/ trusty-updates main
deb-src http://in.archive.ubuntu.com/ubuntu/ trusty-updates main

甚至尝试了 sudo apt update 并使用了 sudo apt install virtualbox-6.1 但得到了这个 W: Target CNF (contrib/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/virtualbox.list:1 and /etc/apt/sources.list.d/virtualbox.list:3

对于 apt 安装 virtualbox-6.1

 virtualbox-6.1 : Depends: libqt5opengl5 (>= 5.0.2) but it is not going to be installed
                  Depends: libqt5printsupport5 (>= 5.0.2) but it is not going to be installed
                  Recommends: libsdl-ttf2.0-0 but it is not installable
E: Unable to correct problems, you have held broken packages.

请建议如何通过 sudo apt install 安装 virtualbox?谢谢。

答案1

您好,/etc/apt/sources.list 中出现错误,并且还有重复的条目,我将其从软件和更新中删除,结果 sudo apt update 开始工作,随后 sudo apt install virtualbox 也开始工作。

相关内容