Uninstalling VirtualBox completely from Ubuntu 25.04 involves removing not only the application itself but also any associated packages, configuration files, and dependencies. Here’s a step-by-step guide to ensure a complete uninstallation:
Step 1: Stop and Remove VirtualBox
First, ensure that VirtualBox is not running and then remove the package.
If you installed VirtualBox Guest Additions on any guest machines, you might want to remove them as well, though this is optional and depends on your setup.
Step 6: Clean Up
Finally, clean up any leftover files and update your package list.
Clean up:
bash
sudo apt clean
sudo apt update
Step 7: Verify Uninstallation
To ensure VirtualBox has been completely removed, you can check for any remaining files or modules.
Verify:
bash
dpkg -l | grep virtualbox
lsmod | grep vbox
If no VirtualBox packages or modules are listed, the uninstallation was successful.
Additional Notes:
DKMS (if used): If you used DKMS to build kernel modules, you might want to remove those as well:
Manual Installations: If you installed VirtualBox manually (not via apt), you may need to manually delete files from /opt/VirtualBox or other locations where you placed the binaries.
By following these steps, you should be able to completely uninstall VirtualBox from Ubuntu 25.04.