virtual-box 未安装或删除

virtual-box 未安装或删除

如何删除并重新安装 virtualbox 以使其正常工作

master@666:~$ sudo apt-get remove virtualbox 
[sudo] password for master: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  kbuild libfprint-2-tod1 libgsoap-2.8.91 libllvm10 libllvm10:i386
  libqt5opengl5 libsdl1.2debian libvncserver1 linux-headers-5.4.0-42
  linux-headers-5.4.0-42-generic linux-image-5.4.0-42-generic
  linux-modules-5.4.0-42-generic linux-modules-extra-5.4.0-42-generic
  module-assistant virtualbox-source
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  virtualbox
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 112 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 211357 files and directories currently installed.)
Removing virtualbox (6.1.10-dfsg-1~ubuntu1.20.04.1) ...
Setting up virtualbox-dkms (6.1.10-dfsg-1~ubuntu1.20.04.1) ...
Removing old virtualbox-6.1.10 DKMS files...

------------------------------
Deleting module version: 6.1.10
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-6.1.10 DKMS files...
Building for 5.8.0-34-generic
Building initial module for 5.8.0-34-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash'
Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64)
Consult /var/lib/dkms/virtualbox/6.1.10/build/make.log for more information.
dpkg: error processing package virtualbox-dkms (--configure):
 installed virtualbox-dkms package post-installation script subprocess returned error exit status 10
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 virtualbox-dkms
E: Sub-process /usr/bin/dpk

答案1

sudo dkms remove -m virtualbox -v 6.1.10  k --all

这是尝试从所有内核版本中删除 virtualbox。

sudo apt purge virtualbox

如果 apt 不起作用

sudo dpkg -P virtualbox virtualbox-dkms virtualbox-qt

我希望我记得我的解决方案是正确的。

相关内容