3

I am running Ubuntu 22.04 and trying to install virtualbox. I am encountering dependency issues that I am unsure of how to resolve.

I tried the following:

$ sudo apt update && sudo apt upgrade 
$ wget https://www.virtualbox.org/download/oracle_vbox_2016.asc
$ cat oracle_vbox_2016.asc | gpg --dearmor | sudo tee /usr/share/keyrings/virtualbox.gpg > /dev/null 2>&1
$ sudo nano /etc/apt/sources.list.d/virtualbox.list  
### added the following line to the above file
deb [arch=amd64 signed-by=/usr/share/keyrings/virtualbox.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib
###
$ sudo apt update
$ sudo apt install virtualbox-7.0 

I see no errors when I run sudo apt update, however when I try to install any version of virtualbox, I get the following output

$ sudo apt install virtualbox-7.0 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
virtualbox-7.0 is already the newest version (7.0.4-154605~Ubuntu~jammy).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 virtualbox-7.0 : Depends: libqt5help5 (>= 5.15.1) but it is not installable
                  Depends: libqt5opengl5 (>= 5.0.2) but it is not installable
                  Recommends: libsdl-ttf2.0-0 but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

I have tried multiple variations of the previous steps with the same results.

I also tried downloading the package binary from https://www.virtualbox.org/wiki/Linux_Downloads for Ubuntu 22.04 and installing it with:

sudo dpkg -i ./virtualbox-7.0_7.0.4-154605_Ubuntu_jammy_amd64.deb 

However, this yielded a similar result:

$ sudo dpkg -i ./virtualbox-7.0_7.0.4-154605_Ubuntu_jammy_amd64.deb 
(Reading database ... 234415 files and directories currently installed.)
Preparing to unpack .../virtualbox-7.0_7.0.4-154605_Ubuntu_jammy_amd64.deb ...
Unpacking virtualbox-7.0 (7.0.4-154605~Ubuntu~jammy) over (7.0.4-154605~Ubuntu~jammy) ...
dpkg: dependency problems prevent configuration of virtualbox-7.0:
 virtualbox-7.0 depends on libqt5help5 (>= 5.15.1); however:
  Package libqt5help5 is not installed.
 virtualbox-7.0 depends on libqt5opengl5 (>= 5.0.2); however:
  Package libqt5opengl5 is not installed.

dpkg: error processing package virtualbox-7.0 (--install):
 dependency problems - leaving unconfigured
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (2.1-2) ...
Errors were encountered while processing:
 virtualbox-7.0

Is there anything anyone might recommend trying?

9
  • 1
    Does sudo apt install ./virtualbox-7.0_7.0.4-154605_Ubuntu_jammy_amd64.deb work? If it does not, then try this: sudo apt --fix-broken install and try running again: sudo apt install ./virtualbox-7.0_7.0.4-154605_Ubuntu_jammy_amd64.deb Commented Dec 29, 2022 at 2:39
  • According to Ubuntu, those packages are available for your version (libqt5help5, libqt5opengl5). Have you enabled the Universe repository those packages reside in? Commented Dec 29, 2022 at 15:29
  • @EdgarMagallon no luck, before and after trying "--fix-broken" I get the following output:
    – user554672
    Commented Dec 29, 2022 at 16:08
  • Note, selecting 'virtualbox-7.0' instead of './virtualbox-7.0_7.0.4-154605_Ubuntu_jammy_amd64.deb' Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
    – user554672
    Commented Dec 29, 2022 at 16:10
  • The following packages have unmet dependencies: virtualbox-7.0 : Depends: libqt5help5 (>= 5.15.1) but it is not installable Depends: libqt5opengl5 (>= 5.0.2) but it is not installable Recommends: libsdl-ttf2.0-0 but it is not installable E: Unable to correct problems, you have held broken packages.
    – user554672
    Commented Dec 29, 2022 at 16:10

2 Answers 2

4

As pointed out in the comments, I needed to first enable the Universe repository.

This solved the issues, and I was able to update and install virtualbox 7.0 successfully.

1
  • 2
    I advise giving the link+the needed steps. There is an old policy of not giving URL only answers in SE, due to links going stale over time. Commented Apr 17, 2023 at 8:27
1

I found the following instructions a few months ago but I don't remember the resource to share it. The next steps helped me fix the same issue:

  1. $ sudo bash -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian eoan contrib" >> /etc/apt/sources.list'
  2. $ wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --dearmor --es --output /usr/share/keyrings/oracle-virtualbox-2016.gpg
  3. $ sudo apt update
  4. $ sudo apt install -y virtualbox-7.0

During these steps you will probably meet some warnings such as: "fix broken install". Follow the recommendations and the above steps.

I hope that my use case will be useful.

P.S. Ubuntu 22.04 LTS user :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .