Completely Remove All VirtualBox Setup/Packages and Folders from Linux Mint

If we are installing virtual box after linux mint update, we might see error "The VirtualBox Kernel Modules Do Not Match This Version of VirtualBox" or rc=-1912.
This might happen due to conflicts with prior installed packages before upgrade.


1. Check the packages which are installed for virtualbox.

himanshu@himanshu-LIFEBOOK-A555 ~ $ dpkg -l | grep virtualbox
rc  virtualbox                              5.2.34-dfsg-0~ubuntu18.04.1                         amd64        x86 virtualization solution - base binaries
rc  virtualbox-5.2                          5.2.22-126460~Ubuntu~xenial                         amd64        Oracle VM VirtualBox
ii  virtualbox-6.0                          6.0.16-135674~Ubuntu~bionic                         amd64        Oracle VM VirtualBox
rc  virtualbox-6.1                          6.1.2-135662~Ubuntu~bionic                          amd64        Oracle VM VirtualBox
ii  virtualbox-dkms                         5.2.34-dfsg-0~ubuntu18.04.1                         all          x86 virtualization solution - kernel module sources for dkms
rc  virtualbox-qt                           5.2.34-dfsg-0~ubuntu18.04.1                         amd64        x86 virtualization solution - Qt based user interface

2. Uninstall  packages for virtual box.

sudo apt-get remove virtualbox* --purge

3. Check again , all the packages would be removed.