无法将 virtualbox 6.1 安装到 Ubuntu 20.04

无法将 virtualbox 6.1 安装到 Ubuntu 20.04

我尝试在 Ubuntu 20.04 上安装 VirtualBox,但没有成功。每次尝试都失败。我想我可能创建了一些我不再具有删除权限的文件。我正在使用我的个人电脑,不知道如何提升权限。我是 Ubuntu 新手。

这是我尝试安装 VirtualBox 时的脚本:

emsys@emsys:~/Downloads$ sudo su
[sudo] password for emsys: 
root@emsys:/home/emsys/Downloads# ls
virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb
root@emsys:/home/emsys/Downloads# dpkg -i virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb
Selecting previously unselected package virtualbox-6.1.
(Reading database ... 182383 files and directories currently installed.)
Preparing to unpack virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb ...
Unpacking virtualbox-6.1 (6.1.16-140961~Ubuntu~eoan) ...
dpkg: dependency problems prevent configuration of virtualbox-6.1:
 virtualbox-6.1 depends on libqt5core5a (>= 5.12.2); however:
  Package libqt5core5a is not installed.
 virtualbox-6.1 depends on libqt5gui5 (>= 5.4.0) | libqt5gui5-gles (>= 5.4.0); however:
  Package libqt5gui5 is not installed.
  Package libqt5gui5-gles is not installed.
 virtualbox-6.1 depends on libqt5opengl5 (>= 5.0.2); however:
  Package libqt5opengl5 is not installed.
 virtualbox-6.1 depends on libqt5printsupport5 (>= 5.0.2); however:
  Package libqt5printsupport5 is not installed.
 virtualbox-6.1 depends on libqt5widgets5 (>= 5.12.2); however:
  Package libqt5widgets5 is not installed.
 virtualbox-6.1 depends on libqt5x11extras5 (>= 5.6.0); however:
  Package libqt5x11extras5 is not installed.
 virtualbox-6.1 depends on libsdl1.2debian (>= 1.2.11); however:
  Package libsdl1.2debian is not installed.
 virtualbox-6.1 depends on python (<< 2.8); however:
  Package python is not installed.
 virtualbox-6.1 depends on python (>= 2.7); however:
  Package python is not installed.
 virtualbox-6.1 depends on python:any (>= 2.6.6-7~); however:

dpkg: error processing package virtualbox-6.1 (--install):
 dependency problems - leaving unconfigured
Processing triggers for systemd (245.4-4ubuntu3.2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (1.15-1) ...
Errors were encountered while processing:
 virtualbox-6.1
root@emsys:/home/emsys/Downloads# apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED
  virtualbox-6.1
0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 216 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 183132 files and directories currently installed.)
Removing virtualbox-6.1 (6.1.16-140961~Ubuntu~eoan) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for shared-mime-info (1.15-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
root@emsys:/home/emsys/Downloads# sudo apt purge virtualbox
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'virtualbox' is not installed, so not removed
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
root@emsys:/home/emsys/Downloads# 

如果我输入ls,我会得到以下结果:

-virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb

我的文件夹计算机/etc/apt/sources.list.d有 4 个文件,它们包含以下内容:

folder oracle.virtualbox.list=# deb http://download.virtualbox.org/virtualbox/debian focal contrib

folder oracle.virtualbox.list.save=# deb http://download.virtualbox.org/virtualbox/debian focal contrib

folder virtualbox.list=# deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian focal contrib

folder virtualbox.list.save=# deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian focal contrib

我需要删除这些文件吗?它们会阻止下载吗?我无法修改这些文本文件。我看到文件显示,但是当我在终端中debian focal输入时,它正在寻找?!!lseoan

答案1

你肯定做错了什么事。

安装 VirtualBox 只需执行两个简单的命令:

sudo apt update
sudo apt install virtualbox

就是这样!

话虽如此,如果您的操作降低了您的源的质量,并且您尝试了其他安装方法但失败了,那么如果 Ubuntu 存储库中的包与您所做的其他操作发生冲突,这些简单的命令可能不再起作用。


目前尚不清楚您做了什么而破坏了您的包管理系统,但看起来您在尝试解决这个问题时引发了多个问题。

您记得或记录了每一项更改吗?如果没有,此时最好的方法可能是重新安装系统。

相关内容