Unable to uninstall Oracle VM Virtualbox

Hello everyone,

I am currently trying to uninstall the Oracle VM Virtualbox application. I first tried with the Fedora software manager (“Software”) but the following error message appeared: “Error -1 during transaction”.

Then I tried with the terminal using the following commands: “sudo dnf remove VirtualBox” and “sudo dnf remove virtualbox” but I get this error message: “No packages marked for removal.”

Upon further enquiry, I was advised to check whether all the dependencies required to uninstall Oracle VM Virtualbox were present using the following command: “sudo dnf check”.
The result was: “VirtualBox-7.0-7.0.10_158379_fedora36-1.x86_64 has unmet requirements: libvpx.so.7()(64bit)”.

I think this error indicates that uninstalling VirtualBox requires the libvpx.so.7()(64bit) library, but it seems to be missing or incompatible with Fedora. To solve this problem, I tried the following steps:

  1. Update Virtualbox with the command:" sudo dnf update", which changed nothing…
  2. Install the missing library: libvpx.so.7 with the command “sudo dnf install libvpx”, which didn’t help either, as the libvpx-1.13.0-2.fc38.x86_64 package was already installed…

And finally, I checked for package conflicts using the “sudo dnf repoquery -duplicates” command, which didn’t help either…

Having run out of solutions, I now turn to any of you who might have a suggestion to help me FINALLY remove Virtualbox for good!

Thank you in advance for reading this long thread and for any suggestions you may have for a solution!

Manuel

sudo dnf remove VirtualBox\*
2 Likes

Usually, you’ll find that VirtualBox isn’t the complete name so you’ll have to dnf remove VirtualBox-7.0 or whatever version you have. @vgaetera’s method also works, but I’m just giving the explanation.

1 Like
 sudo dnf remove VirtualBox-7.0

When using the virtualbox package from oracle, the version number is part of the package name.

1 Like

Hi everyone!

I tried to remove Virtualbox using the full package name VirtualBox-7.0-7.0.10_158379_fedora36-1.x86_64
Here is the result:

[martin@host ~]$ sudo dnf remove VirtualBox-7.0-7.0.10_158379_fedora36-1.x86_64
[sudo] Mot de passe de martin : 
Dépendances résolues.
================================================================================
 Paquet             Architecture
                               Version                       Dépôt        Taille
================================================================================
Suppression:
 VirtualBox-7.0     x86_64     7.0.10_158379_fedora36-1      @@System     209 M

Résumé de la transaction
================================================================================
Supprimer  1 Paquet

Espace libéré : 209 M
Voulez-vous continuer ? [o/N] : o
Test de la transaction
La vérification de la transaction a réussi.
Lancement de la transaction de test
Transaction de test réussie.
Exécution de la transaction
  Préparation           :                                                   1/1 
  Exécution du scriptlet: VirtualBox-7.0-7.0.10_158379_fedora36-1.x86_64    1/1 
/var/tmp/rpm-tmp.uBlV7w: ligne 6: /usr/lib/virtualbox/prerm-common.sh: Aucun fichier ou dossier de ce type
erreur : %preun(VirtualBox-7.0-7.0.10_158379_fedora36-1.x86_64) scriptlet échoué, état de sortie 1

Error in PREUN scriptlet in rpm package VirtualBox-7.0
  Vérification de       : VirtualBox-7.0-7.0.10_158379_fedora36-1.x86_64    1/1 

Échec:
  VirtualBox-7.0-7.0.10_158379_fedora36-1.x86_64                                

Erreur : La transaction a échoué

This specific error message seems to indicate a problem with the PREUN (Pre-Uninstall) script in the RPM package of VirtualBox version 7.0. but I don’t know what I need to do to successfully remove the VirtualBox-7.0 x86_64 7.0.10_158379_fedora36-1 package?

Thanks for your help!

You are using the full name of the rpm. The suggestion was to use only the name as VirtualBox\*.

Have you tried it that way? If not then please do so. The suggested naming allows dnf to properly complete the package name as seen in the rpm database and does not force it to match a long name such as you indicate here (which seems to be failing).

You also could use rpm directly for the removal with something like
sudo rpm -e VirtualBox-7.0-7.0.10_158379_fedora36-1.x86_64 or whatever the actual name of the rpm package is. The full package name could be found with sudo rpm -qa VirtualBox\*

Note that using rpm this way would not manage any required dependencies as is done with dnf.

1 Like
sudo rpm --nopreun -e VirtualBox-7.0-7.0.10_158379_fedora36-1.x86_64

Repair package manager files after removing a package physically - #5 by vgaetera

1 Like

I wouldn’t suggest disabling pre uninstall script for something like virtualbox because is has kernel modules and it has probably hooks to kernel upgrades.

Edit: I don’t have this script on my system either, maybe it is a packaging issue? Virtualbox uninstall properly.

It becomes irrelevant and can be safely removed after upgrading the kernel.

Most likely the file /usr/lib/virtualbox/prerm-common.sh has been removed, or perhaps the entire directlry /usr/lib/virtualbox/ has been removed. You will first need to re-install those files using

dnf reinstall Virtualbox\*

Hi everyone,

I managed to uninstall Virtualbox simply by using the following 2 commands: “sudo dnf remove VirtualBox*” and then “sudo rpm -nopreun -e VirtualBox-7.0-7.0.10_158379_fedora36-1.x86_64”.
Then I simply rebooted my pc and was able to reinstall Virtualbox using the Fedora software manager (“Software”)…

I wanted to thank you for all your answers!