I'm trying to install Okular on Linux Mint XFCE, but apt reports errors during the installation process. The output says that the VirtualBox 7.0.16 DKMS module failed to build for kernel 7.0.0-30-generic, which then caused the kernel and Linux headers packages to remain unconfigured. I'm new to Linux and would appreciate help understanding whether Okular is actually the problem and how to fix the package manager.
3 Answers
This doesn’t look like an Okular build failure. The package manager is trying to finish configuring a kernel update, and the VirtualBox DKMS module can’t compile for that kernel. Check /var/lib/dkms/virtualbox/7.0.16/build/make.log for the specific compiler error. If you don’t need VirtualBox, removing it should allow the kernel packages to finish configuring. If you do need it, install a version from Oracle’s repository or update VirtualBox to a release that supports your kernel.
If you use Flatpak instead, Okular can also be installed with `flatpak install flathub org.kde.okular`. However, Flatpak won’t necessarily fix the already-broken dpkg state, so it’s still worth repairing or removing the failing VirtualBox DKMS module.
You normally don’t need to compile Okular yourself. Install it from the distribution repository with `sudo apt install okular`. The command may still trigger pending package configuration, so after dealing with the VirtualBox DKMS failure, run `sudo dpkg --configure -a` followed by `sudo apt -f install`.
So the Okular package is probably fine; the broken kernel update and VirtualBox module are what make apt report an error.

I may try QEMU/KVM with virt-manager instead, since I don’t specifically need VirtualBox.