无法在 Ubunut 22.04 LTS 中安装 VirtualBox 6.1

无法在 Ubunut 22.04 LTS 中安装 VirtualBox 6.1

我正在尝试在我的 Ubuntu 机器上安装 Virtual-box,它是 x86_64 架构的。

笔记:VirtualBox 用于试用其他版本的 Ubuntu 和其他 Linux 发行版,因此如果有比 Virtual Box 更好的工具,也欢迎提出建议。

我正在遵循VirtualBox 官方文档

按顺序执行的步骤,

  1. 在 sources.list 中添加条目,(由于我的发行版很混乱并且它不起作用,尝试了下面的两种方法,但总体结果仍然相同)
    • 尝试 1deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian bionic contrib
    • 第二次尝试deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian eoan contrib
  2. 添加了 Oracle 公钥
  3. 更新了源列表
  4. 当我尝试做的时候sudo apt-get install virtualbox-6.1

收到以下错误:

Reading  package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
 virtualbox-6.1 : Depends: libssl1.1 (>= 1.1.1) but it is not installable
                  Depends: libvpx6 (>= 1.6.0) but it is not installable
                  Recommends: libsdl-ttf2.0-0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

并且无法像尝试时那样添加/安装这些依赖项sudo apt-get install libssl1.1

出现以下错误:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libssl1.1 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libssl1.1' has no installation candidate

附加信息,在我的“Ubuntu 软件”源中,所有 4 个轨道都已启用 main,universe, restricted, multiverse

答案1

正如 @matigo 所建议的,默认存储库中的“virtualbox”可以正常工作

您可以通过以下方式安装,

  • 使用 apt 命令sudo apt install virtualbox,它将列出所有需要安装的依赖项
  • 使用“Ubuntu 软件”,只需单击即可完成所有操作

然后你需要再做一次配置,在安装过程中,将显示在启动项中添加相应配置的步骤,然后它就可以像魅力一样工作了

相关内容