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 8 '18 at 6:46
  • 1
    @hiigaran it's a fresh install, so it must be – damadam Aug 8 '18 at 6: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 8 '18 at 6: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 8 '18 at 6:57
  • 1
    Did the similar question you linked helped you solved the problem? – avazula Aug 8 '18 at 7:24

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
| improve this answer | |
  • 1
    when I remove that entry from the sources.list file it cant find the package. – Chris Fraser Aug 8 '18 at 8:44
  • 2
    Are you using virtualbox instead of virtualbox-5.2? Have you tried enabling the multiverse repositories? – Katu Aug 8 '18 at 9:15
  • 1
    yes that worked. – Chris Fraser Aug 8 '18 at 9:30
  • 1
    @ChrisFraser that's good. If the answer solved your problem, you can accept it as a valid answer. – Katu Aug 8 '18 at 9:50
  • 2
    well no. the answer did not solve the problem. your comment did. you could put your comment as answer. – Chris Fraser Aug 8 '18 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.