1

I've got a fresh installation of Ubuntu 18.04.1 server running on an HP ProLiant DL380 Generation 7 (G7). I am trying to install VirtualBox 5.2.

I used the tutorial on this website : https://linuxize.com/post/how-to-install-virtualbox-on-ubuntu-18-04/

When I run the command sudo apt-get install virtualbox-5.2 I got.

The following packages have unmet dependencies:  
**virtualbox-5.2 : Depends: libqt5x11extras5 (>= 5.6.0) but it is not installable**  
Recommends: libsdl-ttf2.0-0 but it is not installable  
Recommends: gcc but it is not going to be installed  
Recommends: make but it is not going to be installed or  
build-essential but it is not going to be installed or  
dpkg-dev but it is not going to be installed  
Recommends: binutils but it is not going to be installed  
Recommends: pdf-viewer  
E: Unable to correct problems, you have held broken packages.

I installed virtualbox on monday with the exact same method and it worked then. I have no idea how to fix this. Why does this problem all of a sudden appear?

Update: I just found a very similar question. Install Oracle VirtualBox 5.1 in Ubuntu 16.04

  • 1
    Is your sources.list file set to accept packages from the Bionic universe repository? – hiigaran Aug 08 '18 at 06:46
  • 1
    @hiigaran it's a fresh install, so it must be – damadam Aug 08 '18 at 06:47
  • 1
    Try to install manually libqt5x11extras5 with command sudo apt install libqt5x11extras5 and then, retry to sudo apt-get install virtualbox-5.2 – damadam Aug 08 '18 at 06:48
  • 1
    @damadam
    Package libqt5x11extras5 is not available, but is referred to by anotherpackage. This may mean that the package is missing, has been obsoleted, or is only available from another source

    E: Package 'libqt5x11extras5' has no installation candidate

    – Chris Fraser Aug 08 '18 at 06:57
  • 1
    Did the similar question you linked helped you solved the problem? – avazula Aug 08 '18 at 07:24
  • @avazula No. I downloaded libqt5x11extras package from https://packages.ubuntu.com/xenial/amd64/libqt5x11extras5/download and installed it manually. then I tried to install VirtualBox over the repository(same error as before). And then I downloaded VirtualBox from https://www.virtualbox.org/wiki/Linux_Downloads and tried to install it manually(same error), – Chris Fraser Aug 08 '18 at 07:41
  • Have you tried undoing everything you have done in the sources.list file and then simply sudo apt update and sudo apt install virtualbox? https://askubuntu.com/questions/779095/install-virtualbox-on-ubuntu-16-04-lts/849695#849695 – Katu Aug 08 '18 at 07:48
  • @Katu its a fresh installation. I did not edit the sources.list file. I installed it about 2 hours ago. – Chris Fraser Aug 08 '18 at 07:54
  • @ChrisFraser In the second step of the tutorial you linked, it sudo add-apt-repository will add a repository, probably to the folder /etc/apt/sources.list.d. Remove this repo so when you try to install with normal virtualbox it takes it from the ubuntu repositories instead of the one you added. The ubuntu repo version might be lower but its dependencies will be handled correctly. – Katu Aug 08 '18 at 07:57
  • @Katu ah. now I know what you mean. ok so i removed the repository from the file but then i got: Unable to locate package VirtualBox-5.2 – Chris Fraser Aug 08 '18 at 08:03

1 Answers1

2

I would recommend installing Virtualbox from the Ubuntu repositories, but it might be lower than 5.2 at the moment.

If you have already added a repository (step 2 of the linked tutorial), remove it with this command, from How to remove a repository?

sudo add-apt-repository -r ppa:<ppa to remove>

Or maybe removing the file you created in /etc/apt/sources.list.d/ will also work.

Enable the multiverse repository and update the apt packages with

sudo apt update

And now install latest virtualbox

sudo apt install virtualbox
Katu
  • 3,593
  • 26
  • 42