-1

I had previously uninstalled VirtualBox. Now, I'm trying to re-install it; but, it is not installing.

Here are my actions and results:

~$ 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

However the following packages replace it: 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
Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84

2 Answers2

1

You have three problems.

  1. You should always do a sudo apt-get update before your sudo apt-get install. Next, you need to use the correct package name for Virtualbox which is virtualbox, or virtualbox-5.1 if you have the updated repository in your /etc/apt/sources.list...
deb download.virtualbox.org/virtualbox/debian xenial non-free contrib
  1. You have 3 invalid files in /etc/apt/sources.list.d/, and need to delete them with:
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. The file /etc/apt/sources.list.d/virtualbox.list is invalid and needs to be edited.

Cheers, Al

heynnema
  • 73,649
0

I would try this:

sudo apt purge virtualbox
sudo apt update
sudo apt install virtualbox