如何在删除之后安装 VirtualBox?

如何在删除之后安装 VirtualBox?

我之前卸载了 VirtualBox。现在,我试图重新安装它;但是,安装不成功。

以下是我的行动和结果:

~$ sudo apt-get install virtualbox
    [sudo] password for sudarsan: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Package virtualbox 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

但是以下软件包可以替代它:virtualbox-qt

N: Ignoring file 'virtualbox.list.save.3' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'virtualbox.list.save.2' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'virtualbox.list.save.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Package 'virtualbox' has no installation candidate

答案1

你有三个问题。

  1. sudo apt-get update你应该总是在 之前做一个sudo apt-get install。接下来,你需要使用 Virtualbox 的正确包名称,即虚拟盒, 或者virtualbox-5.1如果你有更新的存储库/etc/apt/sources.list...
deb download.virtualbox.org/virtualbox/debian xenial 非免费贡献
  1. /etc/apt/sources.list.d/ 中有 3 个无效文件,需要使用以下命令删除它们:
sudo rm /etc/apt/sources.list.d/virtualbox.list.save.1  
sudo rm /etc/apt/sources.list.d/virtualbox.list.save.2  
sudo rm /etc/apt/sources.list.d/virtualbox.list.save.3
  1. 该文件/etc/apt/sources.list.d/virtualbox.list无效,需要进行编辑。

干杯,艾尔

答案2

我会尝试这个:

sudo apt purge virtualbox
sudo apt update
sudo apt install virtualbox

相关内容